Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

home / study / questions and answers / engineering / computer science / c++ writ

ID: 3767906 • Letter: H

Question

home / study / questions and answers / engineering / computer science / c++ write a an application that prints the following ... Question -------------------------------------------------------------------------------- C++ Write a an application that prints the following patterns separately one below the other. Use for loops to generate the patterns. All asterisks (*) should be printed by a single statement of the form cout << '*' ; (this causes the asterisks to print side by side). Hint: The last two patterns require that each line begin with an appropriate number of blanks. You will receive 3 points for each pattern that you print out. You can get an extra 3 points if you can get the patterns to print accross as shown below

Explanation / Answer

#include<iostream.h>
#include<conio.h>

void main()
{
   int i,j,s=80;
   clrscr();
   for(i=0;i<25;i++)
   {
       for(j=0;j<s;j++)
       {
           cout<<'*';
       }
       s--;
   }
   getch();
}