please help me

How to modify this program using while loop?


Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
using namespace std;

int main()
{
int x = 5;
int r=0,c;
while ( r < x)
{
c=0;
while( c < x)
{
if ( c == 0 || c == x - 1 || r == 0 || r == x - 1)
cout << "*";
else
cout << " ";
c++;
} // inner while
cout << endl;
r++;
} // outer for
}
Another question
Last edited on
Topic archived. No new replies allowed.