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 is a semicolon (;) put at the end of every program statement?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
What is file in c preprocessor?
What is the use of putchar function?
Describe the modifier in c?
Can we use any name in place of argv and argc as command line arguments?
plz let me know how to become a telecom protocol tester. thank you.
How does sizeof know array size?
Are the expressions * ptr ++ and ++ * ptr same?
When c language was developed?
Why is it that not all header files are declared in every C program?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What are the types of bitwise operator?
What are the difference between a free-standing and a hosted environment?