Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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

Why is a semicolon (;) put at the end of every program statement?

1125


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.

5502


What is file in c preprocessor?

1196


What is the use of putchar function?

1109


Describe the modifier in c?

1145


Can we use any name in place of argv and argc as command line arguments?

1125


plz let me know how to become a telecom protocol tester. thank you.

2239


How does sizeof know array size?

1171


Are the expressions * ptr ++ and ++ * ptr same?

1210


When c language was developed?

1105


Why is it that not all header files are declared in every C program?

1283


write a c program to calculate sum of digits till it reduces to a single digit using recursion

3381


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?

1264


What are the types of bitwise operator?

1166


What are the difference between a free-standing and a hosted environment?

1343