#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<ctype.h>
#include<math.h>
#include<stdlib.h>
void draw(int x1,int y1,int x2,int y2);
void main()
{
int x1,y1,x2,y2;
int gdriver=DETECT,gmode,gerror;
initgraph(&gdriver,&gmode,"c:\\tc\\bgi:");
printf("\n Enter the x and y value for starting point:\n");
scanf("%d%d",&x1,&y1);
printf("\n Enter the x and y value for ending point:\n");
scanf("%d%d",&x2,&y2);
printf("\n The Line is shown below: \n");
draw(x1,y1,x2,y2);
getch();
}
void draw(int x1,int y1,int x2,int y2)
{
float x,y,xinc,yinc,dx,dy;
int k;
int step;
dx=x2-x1;
dy=y2-y1;
if(abs(dx)>abs(dy))
step=abs(dx);
else
step=abs(dy);
xinc=dx/step;
yinc=dy/step;
x=x1;
y=y1;
putpixel(x,y,1);
for(k=1;k<=step;k++)
{
x=x+xinc;
y=y+yinc;
putpixel(x,y,2);
}
}
Ronaldo! 'c' coding of Ricart-agarwala algorithm
yes we can do it,in c
no.
hi.... for DIT fft algorithm, refer to this link, it has c-code for that. http://cnx.org/content/m12016/latest/
pop push c++ programming
Ronaldo! 'c' coding of Ricart-agarwala algorithm
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
Algorithm is a step by step process to solve a particular task.
The algorithm is A/B * C/D = AB/CD.
yes we can do it,in c
no.
It is not C, it's SQL. Non-query means DML (INSERT, UPDATE, DELETE) and DDL (eg CREATE TABLE).
reymond rillera reymond rillera
The efficiency of the C-scan algorithm for disk scheduling is considered to be high. It is a variant of the scan algorithm that improves performance by reducing the seek time of the disk arm. The C-scan algorithm scans the disk in one direction only, which can lead to faster access times compared to other algorithms.
hi.... for DIT fft algorithm, refer to this link, it has c-code for that. http://cnx.org/content/m12016/latest/
There is no specific Hard and Fast rule for writing algorithm. The normal method is the following: 1. get a problem 2. find or invent an algorithm to solve it 3. implement the algorithm in a programming language (C, for example)
pop push c++ programming