Java/PHP/GitLab Fan, Passionate Developer and Loves Teaching

0%

Funny Program

Summary

This is a funny time-pass program.

Give any input and check the output given there.

Idea taken from: mycfiles.com

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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;
}
}
}