Question: C/C++ Language Q1 Write a statement or a set of statements to accomplish each of the following tasks: a) Sum the odd integers between 1

 C/C++ Language Q1 Write a statement or a set of statements

C/C++ Language

Q1 Write a statement or a set of statements to accomplish each of the following tasks: a) Sum the odd integers between 1 and 99 using a for statement. Use the unsigned integer variables sum and count. b) Print the value 333.546372 in a field width of 15 characters with precisions of 1,2,3,4 and 5 . Left justify the output. What are the five values that print? c) Calculate the value of 2.5 raised to the power of 3 using the pow function. Print the result with a precision of 2 in a field width of 10 positions. What is the value that prints? d) Print the integers from 1 to 20 using a while loop and the counter variable x. Print only five integers per line. [Hint: Use the calculation %5. When the value of this is 0 , print a newline character, otherwise print a tab character.]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!