using C programing language Write a simple statement or set of statements to accomplish each of the following tasks: a) Sum the odd integers between 1 and 99 using a for statement. b) Print the integers from 1 to 20 using a while loop and the counter variable x. Assume that the variable x has been defined, but not initialized. Print only five integers per line. [Hint: Use the calculation x % 5. When the value of this is 0, print a newline character, otherwise print a tab character.]

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 6E
icon
Related questions
Question

using C programing language

Write a simple statement or set of statements to accomplish each of the following
tasks:
a) Sum the odd integers between 1 and 99 using a for statement.
b) Print the integers from 1 to 20 using a while loop and the counter variable x.
Assume
that the variable x has been defined, but not initialized. Print only five integers
per line.
[Hint: Use the calculation x % 5. When the value of this is 0, print a newline
character, otherwise print a tab character.]

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr