Thursday, 19 March 2015

Square pattern using Numeric digit single in line

Leave a Comment
Code:

#include<iostream>
using namespace std;
void main()
{
//Square pattern using Numeric digit single in line
int square;
cout<<"Enter The Size of Square = "; // size
cin>>square;
for(int i = 1;i<=square;i++) // outer loop
{
for(int j = 1;j<=square;j++) //inner loop
{
cout<<i<<" "; // value that is output
}
cout<<endl;//new line for next line output
}

}


Output


If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: