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 |
Explain what does it mean when a pointer is used in an if statement?
What functions are used for dynamic memory allocation in c language?
What are the restrictions of a modulus operator?
how do u find out the number of 1's in the binary representation of a decimal number without converting it into binary(i mean without dividing by 2 and finding out the remainder)? three lines of c code s there it seems...can anyone help
Write a program to produce the following output in c language? 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
Where static variables are stored in memory in c?
What is difference between constant pointer and constant variable?
Do you have any idea about the use of "auto" keyword?
What is logical error?
what is the output of printf("%d",(scanf("%d",10));
What Is The Difference Between Null And Void Pointer?
Can anyone tell what is stack overflow? what precaution we should take?