Funny Program

1/27/2012 code-examplecpp

# Summary

This is a funny time-pass program.

Give any input and check the output given there. Idea taken from: mycfiles.com

# Code

#include "stdio.h"
#include "conio.h"

void main()
{
	char ch[] = "I am an IDIOT.";
	char op = 'A';
	int i=0;
	clrscr();
	printf("Press '0' to exit. Enter what you feel:=> ");
	while(op != '0')
	{
		op = getch();
		printf("%c",ch[i++]);
		if(i == 14)
		{
			printf(" ");
			i = 0;
		}
	}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21