Statement of C Program: This Program accepts your name and prints it for the desired number of times
Did you check the following? |
void main()
{
char name[30];
int mtimes , i ;
printf(" What is your name ?");
gets(name);
printf(" How many times to printf you name ?");
scanf("%d" , &mtimes);
i=0;
while(i<mtimes)
{
puts(name);
i++;
}
} /* End of main() */
Output:
What is your name ?
Rajnikant
How many times to print your name ?
4
Rajnikant
Rajnikant
Rajnikant
Rajnikant
0 Response to "Write a C Program that Accepts your Name and Prints it Desired Number of Times by using puts() and gets() Statements"
Post a Comment