How do you loop a program to display your name however times you want it to.

And to display " Hello %s!! Do you want to try again [Y/N]? "

Showing Answers 1 - 3 of 3 Answers

Insert your name. input the number of times you want to display the name.Use any loop and display the name that number of times

Code
  1. #include<stdio.h>

  2. #include<conio.h>

  3. "enter name:");

  4. scanf("%s""how many times you want to display your name:");

  5. scanf("%d""%s

  6. ",name);

  7. getch();

  8. }

  Was this answer useful?  Yes

Rajath

  • Aug 5th, 2011
 

Read the name from the user and until his choice becomes 0 keep printing his input name through the while loop

Code
  1. #include<stdio.h>

  2. #include<conio.h>

  3. "enter name:");

  4.     scanf("%s""%s""

  5. Do you want to continue [1] or not[0]?

  6. ");

  7.         scanf("%d",&a);

  8.     }

  9. }

  10.  

  Was this answer useful?  Yes

jyothisudi

  • Aug 6th, 2011
 

Here is the code

Code
  1. #include<stdio.h>

  2. #include<conio.h>

  3. "enter your name");

  4. scanf("%s""enter the number of times you want to repeat the loop");

  5. scanf("%d""%s""Hello %s!!! do you want to try again Y/N"'Y')

  6. }

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions