program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
Answer Posted / rajarshi bhadra
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=5;i>=0;i--)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Explain the priority queues?
Why does notstrcat(string, "!");Work?
Explain the difference between structs and unions in c?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
What is merge sort in c?
What is stack in c?
What is dynamic dispatch in c++?
How can I change the size of the dynamically allocated array?
c language interview questions & answer
Here is a neat trick for checking whether two strings are equal
What is memory leak in c?
What do you mean by a local block?
how to construct a simulator keeping the logical boolean gates in c
What is function pointer c?
Is fortran faster than c?