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 a byte string?

610


Difference between current previous versions of Java?

549


Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls

1440


What is ordered map in java?

531


What is parsing and its types?

577






What does opcode mean?

525


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

589


what is meant by HQL?

637


What are the actions that can occur when a thread enters blocked state?

573


Explain super keyword in java.

572


What is fundamental datatype?

521


Can an interface implement another interface?

564


What is mysql driver class name?

547


What is the use of optional ?

559


What is token in java?

530