skip to main |
skip to sidebar
RSS Feeds
The blog on almost everything!
The blog on almost everything!
Friday, April 10, 2009
Posted by Sarathganesh
This simple program will do exactly what it says(of course that's why programs are for!),Just type in a phrase like let's say your name and then the number of times you want it to be printed and then viola!!
From this post onwards I'm going to explain the attributes of each program.If you really want to understand then read on or if you just want the code proceed to the last part of this post.
Attributes used here
char, int, printf, scanf, if, else, labels, special options(All explanations about what these are and what the do will be posted eventually.Check back here soon)
Program code
#include<stdio.h>
#include<conio.h>
void main()
{
char[]a;
int b, c;
clrscr():
printf("Enter a phrase/n");
scanf("%s, &a);
printf("How much times do you want %s to be printed?/n", a);
scanf("%d, &b);
x:
printf("%s/n", a);
c++;
if (b<c)
goto x:
else
printf("The program is over");
getch();
}