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

What are data types in c language?

1016


What is #include stdio h and #include conio h?

1043


Is it possible to execute code even after the program exits the main() function?

1283


What is meant by recursion?

1000


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.

2139


Why are all header files not declared in every c program?

1045


What are the advantage of c language?

1006


Explain the advantages and disadvantages of macros.

1036


What is the size of array float a(10)?

1094


What does void main () mean?

1181


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.

2044


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.

2776


Write a program to print factorial of given number using recursion?

964


all c language question

2381


Write a program to know whether the input number is an armstrong number.

1074