This Program will print a 5 x 5 square of stars. It requires no input. The Program uses a constant integer in the event you wish to change the sizes.
//for Loop for Square
#include <iostream>
void main ()
*****
*****
*****
*****
*****
//for Loop for Square
#include <iostream>
void main ()
Here is What this square would Look Like :{
const ont SIZE = 5;
for ( int r = 1; r <=SIZE;r++)
{
for (int c = 1;c <= SIZE;c++)
{
cout<<"*";
}
cout<<endl;
}
return 0;
}
*****
*****
*****
*****
*****
0 komentar:
Posting Komentar