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

Answer Posted / manojkumar challagundla

#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
int ctr=1;
for(i=1;i<=4;i++)
{
printf("\n")
for(j=1;j<=i;j++)
{
printf("%d",ctr);
ctr++;
}
}
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between a for loop and a while loop? What are it uses?

677


What are the types of arrays in c?

627


how can I convert a string to a number?

602


What are disadvantages of C language.

652


What is the difference between c &c++?

651






What does != Mean in c?

594


The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

669


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

923


What is c mainly used for?

601


how do you execute a c program in unix.

641


Compare and contrast compilers from interpreters.

687


Are the outer parentheses in return statements really optional?

581


What are the characteristics of arrays in c?

618


What is the difference between volatile and const volatile?

572


What is property type c?

609