Write a C program to get the desired output.


1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
.
.
.
1 n..............n 1
Note: n is a positive integer entered by the user.

Answer Posted / ch.mahathi

could anyone please assist me in getting the output in the following way?

For example, if you have entered a pin number like 532211 as the input to the program , then the output should be like this



(5)+(5+3)+(5+3+2)+(5+3+2+1)+(5+3+2+2+1)+(5+3+2+2+1+1)

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string constants?

670


in linking some of os executables are linking name some of them

1661


please explain every phase in the "SDLC" in the dotnet.

2185


Explain what is a pragma?

600


What are local static variables? How can you use them?

653






What is the size of enum in c?

631


What are the different categories of functions in c?

657


What is the use of the function in c?

611


Differentiate between the = symbol and == symbol?

726


The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.

1078


What are header files in c?

627


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

730


Can you pass an entire structure to functions?

708


Write a program to use switch statement.

668


Explain the use of fflush() function?

631