In: Computer Science
Code:
#include <stdio.h>
#include<conio.h>
int main()
{
int i;
char ch;
for(int i=0;i<=20;i++)
{
printf("\ncount = %d",i);
printf("\nPress enter to count next.\nPress x to quit. ");
scanf("%c",&ch);
if(ch=='x')
break;
if(i==20)
i=-1;
printf("%c",ch);
}
return 0;
}
Output: