Code:
#include<iostream>
using namespace std;
void main()
{
int size=0;
cout<<"Enter size = ";
cin>>size;
//outer loop for handling columns
for(int i=0;i<5;i++)
{
//inner loop is for handling rows
for(int j=0;j<size;j++)
{
cout<<char(i+65)<<" ";
}
cout<<endl;
}
}
Output
#include<iostream>
using namespace std;
void main()
{
int size=0;
cout<<"Enter size = ";
cin>>size;
//outer loop for handling columns
for(int i=0;i<5;i++)
{
//inner loop is for handling rows
for(int j=0;j<size;j++)
{
cout<<char(i+65)<<" ";
}
cout<<endl;
}
}
Output
0 Questions:
Post a Comment