how can i get output like this?
1
2 3
4 5 6

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
printf("enter the terms :");
scanf("%d",&n);
count=1;
for(int i=1;i<=n;i++)
{
for(int j=1;j<=(i);j++)
printf("%d ",count++);
printf("\n");
}
getch();
}


thank u

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What’s the special use of UNIONS?

663


What is the use of a static variable in c?

596


how logic is used

1504


int far *near * p; means

3129


Does free set pointer to null?

569






What is table lookup in c?

635


What is the difference between malloc() and calloc()?

621


write a program to create a sparse matrix using dynamic memory allocation.

4376


What does c mean?

594


Write a code of a general series where the next element is the sum of last k terms.

598


What is the code in while loop that returns the output of given code?

1335


Can we declare variable anywhere in c?

541


What does printf does?

753


What standard functions are available to manipulate strings?

568


What functions are in conio h?

665