C program – Spiral Model

by Nideesh C on April 17, 2011 · 0 comments

in C Programming




#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();
}



Not Satisfied ? Just search & get the result

Related Posts Plugin for WordPress, Blogger...
Be Sociable, Share!

Related posts:

  1. C Program – Implement the midpoint circle drawing algorithm
  2. C program – Moving Car
  3. Fish Movement Using C Program
  4. C program to find the sum of two one-dimensional arrays using Dynamic Memory Allocation
  5. C program to read A (MxN), find the transpose of a given matrix and output both the input matrix and the transposed matrix.

Leave a Comment

Previous post:

Next post: