Write a program to produce the following output:
1
2 3
4 5 6
7 8 9 10
Answer Posted / 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 |
Post New Answer View All Answers
Why pointers are used?
Is c high or low level?
What is formal argument?
In C programming, how do you insert quote characters (‘ and “) into the output screen?
What is pointer to pointer in c language?
What do you mean by scope of a variable in c?
Do you know the use of 'auto' keyword?
Explain argument and its types.
can anyone please tell about the nested interrupts?
What are the __date__ and __time__ preprocessor commands?
List the different types of c tokens?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
How to write c functions that modify head pointer of a linked list?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
How many loops are there in c?