Home » » Simple Square

Simple Square

Written By Unknown on Sabtu, 21 Januari 2012 | 22.39

Lab RPL .
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 ()
{
const ont SIZE = 5;
for ( int r = 1; r <=SIZE;r++)
{
for (int c = 1;c <= SIZE;c++)
{
cout<<"*";

}
cout<<endl;
}
return 0;
}
Here is What this square would Look Like :
*****
*****
*****
*****
*****

0 komentar:

Posting Komentar