rohit ranjan


{ City } vellore
< Country > india
* Profession * student
User No # 116679
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 2
Users Marked my Answers as Wrong # 1
Questions / { rohit ranjan }
Questions Answers Category Views Company eMail




Answers / { rohit ranjan }

Question { Mu Sigma, 61118 }

Write a program in c to print
1
121
12321
1234321
123454321


Answer

#include
using namespace std;
int main()
{
int i,j,k,t,n,c,a[20];
cin>>t;
for(k=0;k<20;k++)
a[k]=(k+1);
while(t--)
{
cin>>n;
for(i=0;i {
c=i-1;
for(j=0;j<(2*i+1);j++)
{
if(i>=j)
cout< else
{
cout< c--;
}
}cout<<" ";
}cout< }
return 0;
}

Is This Answer Correct ?    2 Yes 1 No