Saturday 17 November 2012

Pattern Print Code with Nested For Loop


Write a program that will print the following pattern.
* * * * *
* * * * *

* * * * *
* * * * *

* * * * *



#include <iostream>
#include <math.h>
using namespace std;
int main()
{
for (int i=1;i<=5;i++)
{
for(int j=1;j<=5;j++)
cout <<" * ";
cout<<endl;
}
return 0;
}

No comments:

Post a Comment