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

Answer Posted / karthickumar

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

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between getch() and getche() in c?

567


int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer

665


What is volatile variable in c?

660


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1989


how do you execute a c program in unix.

641






How can I run c program?

692


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1263


What is wrong with this code?

701


What is the best style for code layout in c?

634


What type is sizeof?

592


What does static variable mean in c?

657


What are the __date__ and __time__ preprocessor commands?

579


What is volatile keyword in c?

587


explain what is an endless loop?

615


Subtract Two Number Without Using Subtraction Operator

360