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
What are data types in c language?
What is #include stdio h and #include conio h?
Is it possible to execute code even after the program exits the main() function?
What is meant by recursion?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Why are all header files not declared in every c program?
What are the advantage of c language?
Explain the advantages and disadvantages of macros.
What is the size of array float a(10)?
What does void main () mean?
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Write a program to print factorial of given number using recursion?
all c language question
Write a program to know whether the input number is an armstrong number.