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

Why super is first line in java?

564


What is the definition of tree ?

593


What is a 16 bit word?

569


What are the rules for variable declaration?

508


What is a parameter in simple terms?

565






What is the main function in java?

533


Are arrays primitive data types?

646


What is a superclass?

931


What is pre increment and post increment in java?

510


Explain the selection sort algorithm?

648


What is java reflection api?

562


Is void a type?

587


What is an example of a conditional statement?

571


Define "Access specifiers" in java.

615


Why main() method is public, static and void in java ?

601