Given an int variable n that has already been declared and
initialized to a positive value, and another int variable
j that has already been declared, use a do...while loop to
print a single line consisting of n asterisks. Thus if n
contains 5, five asterisks will be printed. Use no variables
other than n and j .
Answers were Sorted based on User's Feedback
Answer / venkadesan
n is not get the values
so,it'a no either printed
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mahfooz
//1st method..
there is no use of j.as explained below
int j,n=psitive value;
do
{
cout<<"*";
n--;
}while(n!=0);
//2nd we can use j..
int j=0;
do
{
cout<<"*";
j++;
}while(j!=n);
| Is This Answer Correct ? | 11 Yes | 14 No |
To generate the series 1+3+5+7+... using C program
Write down the difference between c. Loop and goto statement d. (!0) and (!1) e. (1= =! 1) and (1!=1) f. NULL and !NULL
void main() { int i=5; printf("%d",i+++++i); }
how to convert decimal to hexadecimal without using arrays just loops
write a profram for selection sort whats the error in it?
how tally is useful?
Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
Given an int variable n that has been initialized to a positive value and, in addition, int variables k and total that have already been declared, use a do...while loop to compute the sum of the cubes of the first n whole numbers, and store this value in total . Thus if n equals 4, your code should put 1*1*1 + 2*2*2 + 3*3*3 + 4*4*4 into total . Use no variables other than n , k , and total .
Answering Yes or No in C++...using only stdio.h and conio.h..........help me please...? here's must be the output of the program: Screen A Exam No. items Score 1 20 20 2 35 35 Another Entry? [Y] or [N] : Screen B: Record No. Student's Name: 1 Fernando Torres 2 Chuck Norris Note: if you press Y, the program must repeat the procedure in screen A, then if N, the program must proceed to the screen B....Please Help me out............
void main() { int i=1; printf("%d%d%d",i,++i,i++); } Cau u say the output....?
Write a c-programe that input one number of four digits and find digits sum?