program for following output using for loop?
1 2 3 4 5
2 3 4 5
3 4 5
4 5
5
Answer Posted / ep
#include <stdio.h>
int main()
{
for ( int i = 1; i <= 5 ; i++ ) {
for ( int j = i; j <= 5 ; j++ ) {
if ( i != j ) printf (" ");
printf( "%d", j );
};
printf("\n");
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Why use int main instead of void main?
What is a structure in c language. how to initialise a structure in c?
What are valid operations on pointers?
write a program to copy the string using switch case?
What is the correct declaration of main?
What is the use of a conditional inclusion statement in C?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
write a program in c language to print your bio-data on the screen by using functions.
Can we replace the struct function in tree syntax with a union?
What does c mean?
Function which gives a pointer to a binary trees const an integer value at each code, return function of all the nodes in binary tree.?
Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
Why does the call char scanf work?
How can a program be made to print the name of a source file where an error occurs?
Can we declare variable anywhere in c?