Below is the source code for C program to implement Spiral Model in Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C program to implement Spiral Model in Graphics */
#include<graphics.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int r=5,n,i,x,y;
int graphdriver = DETECT, graphmode;
initgraph(&graphdriver, &graphmode, "..\\bgi");
setcolor(YELLOW);
printf("ENTER THE NUMBER OF RINGS IN THE SPIRAL MODEL\n");
scanf("%d",&n);
printf("Enter the origin point of the spiral");
scanf("%d%d",&x,&y);
clrscr();
for(i=0;i<n;i++)
{
arc(x,y,0,180,r=r+2);
arc(x+2,y,180,360,r=r+2);
}
getch();
closegraph();
}
Above is the source code for C program to implement Spiral Models in Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .
Below is the source code for C program to implement Spiral Model in Graphics which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
Above is the source code for C program to implement Spiral Models in Graphics which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer