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


Please Help Members By Posting Answers For Below Questions

What is the maximum size of byte array in java?

538


Are global variables initialized to zero?

507


What is type safety in java?

480


What do you mean by multithreaded program?

548


Does a class inherit the constructors of its superclass in java programming?

522






Explain about interthread communication and how it takes place in java?

540


Why multiple inheritance is not supported by java?

509


How do you replace all in word?

521


What is exception in java?

563


Is stringwriter thread safe?

552


If an application has multiple classes in it, is it okay to have a main method in more than one class?

534


Explain where variables are created in memory?

578


Explain the purpose of garbage collection in Java?

566


What is the purpose of the system class in java?

552


What is function and method in java?

518