41. C Program to Print Your Name in N times.
How does this program work?
- In this program your going to learn about how to learn for loop using C-Language.
Here is the code
#include <stdio.h>
int main(void)
{
//Declare the variable
int count,n;
char name[50];
//Input value of name
printf("Enter the name: \n");
scanf("%s",name);
//Number of times declare
printf("Enter Number of times to repeat:\n");
scanf("%d",&n);
//Counter initialization with 1
count=1;
//Defining lable
start:
printf( "%s, ",name);
count++;
if(count<=n)
goto start;
return 0;
}