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 |
quoroum of computer languages?
write a profram for selection sort whats the error in it?
void main() { int i=5; printf("%d",i+++++i); }
how to convert decimal to binary in c using while loop without using array
50 Answers Apple, Aptech, Arwen Tech, BCS, C2D Software, CEC,
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
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 .
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
How to convert hexadecimal to binary using c language..
1 Answers Bajaj, GAIL, Satyam, Zenqa,
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
how to convert decimal to hexadecimal without using arrays just loops
main() { char c; for(c='A';c<='Z';c++) getch(); }