how can i get output like this?
1
2 3
4 5 6
Answers were Sorted based on User's Feedback
Answer / nayan soni
#include <stdio.h>
#include <conio.h>
void main()
{
int count = 1;
for(int i = 1;i <= 3;i++)
{
for(int j = 1;j <= i;j++)
{
printf("%d ", count);
count++;
}
printf("\n");
}
getch();
}
It works perfectly.. Tested by running the program..
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / 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 |
#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 |
Answer / sarvesh
#include<stdio.h>
#include<conio.h>
main()
{
int i,n,j;
int m=1;
clrscr();
printf("enter number");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(j=0;j<=i;j++)
{
printf("%d",m++);
}
printf("\n");
}getch();
}
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / 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 |
Answer / 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 |
what is the diffrenet bettwen HTTP and internet protocol
Efficient data structure for store/search list of 1000 records a)array b)double linked list c)circular queue d)hash table
How to swap 3 numbers without using 4th variable?
what is difference between getchar,putchar functions and printf and scanf function? does putchar show output only when input given to it
. Consider the following program main() { int a[5]={1,3,6,7,0}; int *b; b=&a[2]; } The value of b[-1] is (A) 1 (B) 3 (C) -6 (D) none
what is the difference between normal variables and pointer variables..............
15 Answers HP, Infosys, Satyam, Vivekanand Education Society,
How are portions of a program disabled in demo versions?
Is c++ based on c?
What is the difference between variable declaration and variable definition in c?
what is the difference between 123 and 0123 in c?
write c program without semicolon
11 Answers MindTech, TCS, Wipro,
find a number whether it is even or odd without using any control structures and relational operators?
22 Answers Microsoft, Shashank Private Limited,