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


Please Help Members By Posting Answers For Below Questions

List the difference between a 'copy constructor' and a 'assignment operator' in C?

632


What is the full form of getch?

573


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

718


how is the examination pattern?

1587


show how link list can be used to repersent the following polynomial i) 5x+2

1672






how logic is used

1493


How to declare a variable?

562


What is int main () in c?

618


What language is c written?

570


What is const and volatile in c?

561


By using C language input a date into it and if it is right?

565


A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?

1767


What is the need of structure in c?

558


What language is lisp written in?

609


What is the size of empty structure in c?

582