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 |
printy(a=3,a=2)
what is exceptions?
How to reverse a linked list without using array & -1? Thank you.
what is run time error?
how to convert decimal to hexadecimal without using arrays just loops
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 .
what is the large sustained error signal that eventually cause the controller output to drive to its limit
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?
How to develop a program using C language to convert 8-bit binary values to decimals. TQ