program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5

Answer Posted / jayaraj.s

#include <stdio.h>
main()
{
int a,b,i=1;
for(a=i;a<=5;a++)
{
for(b=a;b<=5;b++)
{
printf("%d",b);
}
printf("\n");
i++;
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what standard functions are available to manipulate strings?

604


How do you define structure?

557


What are the 4 types of functions?

561


Explain what is dynamic data structure?

638


What is FIFO?

666






Write programs for String Reversal & Palindrome check

592


Does c have circular shift operators?

716


Explain what does it mean when a pointer is used in an if statement?

611


What are linked lists in c?

641


How to delete a node from linked list w/o using collectons?

2081


hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...

1435


why do some people write if(0 == x) instead of if(x == 0)?

647


Why do we need functions in c?

544


Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon

5458


why use functions a) writing functions avoids rewriting the same code over and over b) using functions it becomes easier to write programs and keep track of what they are doing c) a & b d) none of the above

646