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

Answer Posted / arun asokan

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

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you construct an increment statement or decrement statement in C?

745


Is it better to use a macro or a function?

658


What is the symbol indicated the c-preprocessor?

696


What is the general form of a C program?

600


Why doesnt that code work?

602






 write a program that will open the file, count the number of occurences of each word in the the complete works of shakespeare.  You will then tabulate this information in another file.

1731


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

763


What are type modifiers in c?

623


Where static variables are stored in c?

588


Differentiate between calloc and malloc.

761


Is a house a shell structure?

697


Why header file is used in c?

577


How can I open files mentioned on the command line, and parse option flags?

596


What is the difference between exit() and _exit() function in c?

584


Tell us bitwise shift operators?

600