Computer Science, asked by barshushi281, 11 months ago

Write a program in c++ that reads in a number n and prints out n rows each containing star character * thus if n is 3

Answers

Answered by kushdama
0

Answer:

hahahahhahahahagahahahahahahahahhahaha

Answered by franktheruler
0

Answer:

Explanation:

 Program in c++ that reads in a number n and prints out n rows each containing star character * thus if n is 3    

#include <iostream>

using namespace std;

int main ( )

{

int n, i, j  ;

cout << " Enter the value of n" ;

cin >> n ;

//looping starts

for( i=1 ; i<=n ; i++ )

 {

   for(int j=1;j<=n;j++)

     {

         cout << " * " ;

      }

}

return 0 ;

}  // end main

Note:  In c++, cout is an object of class ostream and this is used to display the output to the device which is monitor.

And cin is an object of class istream and it is used to accept the input from the input device which is keyboard.  

Similar questions