How to print this -
1
12
234
3456
45678
#include<stdio.h>
#include<conio.h>
int main()
{
int row,column,x;
for(row=1;row<=5;row++)
{
for(column=1;column<row+1;column++)
{
x=row+column-2;
if(x==0)
printf("1");
else
printf("%d",x);
}
printf("\n");
}
}
Code is 100% working.
Compiled with GCC 4.6.1 with -std=c99 option enabled.
IDE = orwell Dev-C++ v5.2.0.3

No comments:
Post a Comment