program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
Answer Posted / letskools
I think th correct program is this for the above output
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
clrscr();
for(i=0;i<=5;i++)
{
for(j=i;j<=5;j++)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
What is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How do you override a defined macro?
What is the use of a static variable in c?
write a program to generate address labels using structures?
What is table lookup in c?
Explain built-in function?
Is there a way to compare two structure variables?
What is the difference between union and structure in c?
What are the types of type specifiers?
What is c language and why we use it?
What would the following code segment printint k = 8;docout << "k = " << k << " ";while k++ < 5; a) 13 b) 5 c) 8 d) pointers
What is the difference between text files and binary files?
Differentiate between full, complete & perfect binary trees.
How can I make sure that my program is the only one accessing a file?
Why does everyone say not to use scanf? What should I use instead?