Write a program to produce the following output:
1
2 3
4 5 6
7 8 9 10
Answer / ashok kumar
void main()
{
int n,i,j,k=1;
clrscr();
printf("\n Enter a number : ");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=i;j<n;j++)
printf(" ");
for(j=1;j<=i;j++)
printf(" %d ",k++);
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 31 Yes | 19 No |
What is the size of enum in bytes?
How can I open files mentioned on the command line, and parse option flags?
Explain the advantages and disadvantages of macros.
Differentiate call by value and call by reference?
program that accepts amount in figures and print that in words
2 Answers Infosys, Lovely Professional University, Wipro,
If null and 0 are equivalent as null pointer constants, which should I use?
Is c high or low level?
What is chain pointer in c?
Explain the properties of union. What is the size of a union variable
develop algorithms to add polynomials (i) in one variable
Explain the array representation of a binary tree in C.
simple c program for 12345 convert 54321 with out using string