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 are extern variables in c?
What is meant by type casting?
While compiling a c program,graphics header files are not including in my program..eg: <graphics.h>,what may be the problem...is there any environment settings exists.
which will be first in c compiling ,linking or compiling ,debugging.
What are the 5 data types?
Why #include is used in c language?
how to return 1000 variables from functio9n in c?plz give me code also
What is c language & why it is used?
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
#include<stdio.h> { printf("Hello"); } how compile time affects when we add additional header file <conio.h>.
What are header files in c programming?
What does %c do in c?