program for following output using for loop?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answers were Sorted based on User's Feedback
Answer / natu
Hellow Sashi Ur wrong because Ur program is giving output as
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
but the expected output is
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
please refer and tell me
Is This Answer Correct ? | 49 Yes | 0 No |
Answer / lohith
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 43 Yes | 9 No |
Answer / devi
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 19 Yes | 2 No |
Answer / jayaraj.s
#include <stdio.h>
main()
{
int a,b;
for(a=1;a<=5;a++)
{
printf("\n%d",a);
for(b=1;b!=a;b++)
{
printf("%d",a);
}
}
getch();
}
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / sampath
for(i=1;i<=5;i++){
for(j=i;j<=i;j++)
printf("%d",i);
printf("\n");
}
Is This Answer Correct ? | 6 Yes | 1 No |
Answer / pra japati apurv d
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / aky
#include<iostream.h>
#include<conio.h>
void main()
{
for(int i=1;i<=10;i++)
{
for(int j=1;j<=i;j++)
{
cout<<j;
}
cout<<endl;
}
}
Is This Answer Correct ? | 4 Yes | 3 No |
Answer / shashi kumar c.a
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
}
getch();
}
Is This Answer Correct ? | 13 Yes | 20 No |
what are the advantages of a macro over a function?
When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?
What is local and global variable in c?
write a c program to check weather a particluar bit is set or not?
What is structure padding in c?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
write a program to find a given no. is divisible by 3 or not without using any arthimetic operators?
Write a program to enter the name and age. If age>28 then find salary categories. if age<28 then find that you are gaduate or not.
Explain the use of keyword 'register' with respect to variables.
Explain about the functions strcat() and strcmp()?
Is a house a mass structure?
What is header file in c?