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 |
how we do lcm of two no using c simple if while or for statement
What does %f mean c?
how to find out the biggest element (or any other operation) in an array which is dynamic. User need not to mention the array size while executing.
Explain what is the difference between text files and binary files?
What are valid operations on pointers?
Which of the following data structures is on average the fastest for retrieving data: 1) Binary Tree 2) Hash Table 3) Stack
What is difference between array and pointer in c?
main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
proc() { static i=10; printf("%d",i); } If this proc() is called second time, what is the output?
Is a house a mass structure?
Explain about the constants which help in debugging?
explain what is fifo?