Question: Write a C# statement or a set of C# statements to accomplish each of the following tasks: a) Sum the odd integers between 1 and

Write a C# statement or a set of C# statements to accomplish each of the following tasks:

a) Sum the odd integers between 1 and 99, using a for statement. Assume that the integer variables sum and count have been declared.

b) Calculate the value of 2.5 raised to the power of 3, using the Pow method.

c) Display the integers from 1 to 20 using a while loop and the counter variable i. Assume that the variable i has been declared, but not initialized. Display only five integers per line. 

d) Repeat part (c), using a for statement.

Step by Step Solution

3.46 Rating (153 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a sum... View full answer

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 Visual C How Program Questions!