google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to display a name desired number of times - 2nd puc computer science

Write a program to display a name desired number of times

Write a program to display a name desired number of times.

#include<stdio.h>

#include<conio.h>

void main()

{

char name[15];

int n,i=1;

printf("Enter your name: ");

gets(name);

printf("How many times do you want to print? ");

scanf("%d",&n);

while(i<=n)

{

puts(name);

i++;

}

getch();

}

Output:

Enter your name: Hanumanth Ladwa

How many times do you want to print? 3

Hanumanth Ladwa                                                                

Hanumanth Ladwa                                                                

Hanumanth Ladwa                   

Write a program to display a name desired number of times Write a program to display a name desired number of times Reviewed by Vision Academy on December 08, 2021 Rating: 5

No comments:

CheckOut

Powered by Blogger.