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 difference between global variable & static variable declared out side all the function in the file.
WRITE A PROGRAM TO FIND A REVERSE OF TWO NO
write a program to copy a string without using a string?
What are file streams?
What is the output of below code? main() { static int a=5; printf("%3d",a--); if(a) main(); }
What is the exact difference between '\0' and ""
What is the difference between declaring a variable and defining a variable?
Is return a keyword in c?
What is void pointers in c?
What does the function toupper() do?
Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.
If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above