Given an int variable k that has already been declared, use a do…while loop to print a single line consisting of 97 asterisks. Use no variables other than k.

7
Given an int  variable k that has already been declared, use a do…while loop to print a single line consisting of 97 asterisks. Use no variables other than k.

LANGUAGE: C++

CHALLENGE:

Given an int variable k that has already been declared, use a do…while loop to print a single line consisting of 97 asterisks. Use no variables other than k.

SOLUTION:


k=1;
do
{
    cout << "*";
    k++;
}
while (k<=97);

7 comments

Add comment