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
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 no's vertically.
printf ("x")
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?
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]
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 no's vertically.
How do you write a program with do while loop so that the output is 123456 =720
int i=0; while (i++<n) { /*...*/ }
Wr
Exactly what do you mean by 'C program in Java'
//program to find the factorial value f any number using while loop #include<stdio.h> void main() { int i,n,fact=1; printf("Enter the number\n"); scanf("%d",&n); i=n; while (i>=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
Not used
printf ("x")
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?
I turn on my computer and when Windows has loaded I start Code::Blocks. Code::Blocks is an IDE that I use with Mingw. In Code::Blocks I start a new project and add a source file. I type my program in the window with the flashing cursor. How do you write a program, it looks to me that the way you do it is to plagiarize someones work and call it your own. When you do your exams you will look really.
Yes. The same goes for for-loop and do-while-loop.