program for following output using for loop?
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
Answer Posted / 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 |
Post New Answer View All Answers
Why are all header files not declared in every c program?
What are the disadvantages of a shell structure?
Explain function?
Differentiate call by value and call by reference?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Can we compile a program without main() function?
Is c++ based on c?
What is nested structure in c?
Explain how do you use a pointer to a function?
What is the difference between struct and typedef struct in c?
What are the restrictions of a modulus operator?
Are c and c++ the same?
write a program for the normal snake games find in most of the mobiles.
swap 2 numbers without using third variable?
What are the advantages and disadvantages of a heap?