Program to output as below formate:
1
2 3
4 5 6
7 8 9 10
Answer Posted / koushik sarkar
#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,j,k;
clrscr();
for(j=0;j<4;j++)
{
for(k=0;k<=j;k++)
{
printf("%d "",i);
i++;
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Can we split string with in java?
How can you make a class serializable in java?
What is the purpose of assert keyword used in jdk1.4.x?
What is the difference between int and integer in java?
How to make a non daemon thread as daemon?
Implement a stack with push (), pop() and min() in O(1) time.
Explain the scope or life time of class variables or static variables?
What do you understand by looping in java? Explain the different types of loops.
Why chararray() is preferred over string to store the password?
What is difference between add() and addelement() in vector?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
Define interface in java?
How can you read an integer value from the keyword when the application is runtime in java? example?
What is oops in java?
Explain the features of java?