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

Answer Posted / atul shukla

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

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pass by reference in functions?

325


What is a nested loop?

651


Write a C program in Fibonacci series.

635


What is the use of bit field?

644


What are the salient features of c languages?

625






What is the difference between ++a and a++?

695


What does %c mean in c?

652


Explain what are preprocessor directives?

629


What is the difference between null pointer and wild pointer?

640


What is the default value of local and global variables in c?

559


the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none

649


Where are the auto variables stored?

626


What is the need of structure in c?

566


Why is it important to memset a variable, immediately after allocating memory to it ?

1555


Is it valid to address one element beyond the end of an array?

675