answersLogoWhite

0


Best Answer

char YorN; //I named this after Yes or No

do

{

cout<< "Do you want to continue (Y/N)? "; //You have to answer this with a 'Y' or 'N' to continue

cin >> YorN;

}

while((YorN !='Y')&&(YorN !='N')&&(YorN !='y')&&(YorN !='n')); //This ends the program when the user has -

entered either of these characters: 'Y', 'y', 'N', 'n'.

//The while keeps activating until YorN equals 'Y', 'y', 'N', 'n'.

I hope this has helped you! :D

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

from:

while (exp) stmt

to:

for (;exp;) stmt

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

while (1) puts ("press Ctrl+C");

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program using do while loop?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program that will graph using for loop?

A = 5do{statement;A = A + 1;} while (A < 10)


Using while loop write a program which calculates the product of digits from 1 to 5 and also show these nos vertically?

Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.


How do you write a program with do while loop so that the output is 123456 equals 720?

How do you write a program with do while loop so that the output is 123456 =720


How do you write a c program to print n no's required using while loop?

int i=0; while (i++&lt;n) { /*...*/ }


How do you write a c program to design calculator using loop?

Wr


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Write a program using while loop?

//program to find the factorial value f any number using while loop #include&lt;stdio.h&gt; void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&amp;n); i=n; while (i&gt;=1) { fact=fact*i; i--; } printf("The factorial value=%d",fact); } the above is a program for calculating tha factorial value of any number which is entered by the user


C program algorithm for simple interest using while loop?

Not used


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")


Can you write switch statement with in while loop?

Yes. The same goes for for-loop and do-while-loop.


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?


How do you loop a program in python 3?

A program can be looped in Python by wrapping the entire program in a for or while loop. If you wish to loop the program a finite amount of times, it can be done like so (x = the amount of times you want it to loop, this can be a number or variable storing a number): for i in range(0,x): [code] If you wish to loop the program infinitely, you can use a simple while loop: while True: [code]