C Programming language

adplus-dvertising
C Program example: Accept number until it becomes zero
Previous Home Next
Program that accept the number until it becomes zero
/** Program that accept the number until it becomes zero **/

#include<stdio.h>
#include<conio.h>
void main()
{
	int num;
	clrscr();
	do
	{
		printf("Enter number");
		scanf("%d",&num);
		fflush(stdin);
	}
	while(num>0);
	getch();
}
Output:

Enter number

34

Enter number

65

Enter number

ghj

Enter number

9876

Enter number

0

Previous Home Next