1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Leni [432]
2 years ago
12

Write a program that uses while loops to perform the following steps: Step a: Prompt the user to input two integers: firstNum an

d secondNum (firstNum must be less than secondNum). Step b: Output all odd numbers between firstNum and secondNum. Step c: Output the sum of all even numbers between firstNum and secondNum. Step d: Output the numbers and their squares between 1 and 10. Step e: Output the sum of the square of the odd numbers between firstNum and secondNum. Step f: Output all uppercase letters.
Engineering
1 answer:
Elodia [21]2 years ago
8 0

Answer:

#include<iostream>  

using namespace std;  

int main()

{

    int i, sum = 0, sqSum = 0, firstNum = 1, secondNum = 0;

    char ch;

    while (!(firstNum < secondNum))

    {

         cout << "Enter starting number: ";

         cin >> firstNum;

    cout<<"Enter ending number(must be > startingNumber): ";

         cin >> secondNum;

    }

    i = firstNum;

    cout << "The odd numbers between " << firstNum

         << " and " << secondNum << " are:\n";

    while (i <= secondNum)

    {

         if (i % 2 == 0)

             sum = sum + i;

         else

         {

             cout << i << " ";

             sqSum = sqSum + i * i;

         }

         i++;

    }

    cout << "\n\nThe sum of the even numbers is:"

         << sum << endl << endl;

    cout << "The sum of squares the odd numbers is:"

         << sqSum << endl;

    i = 1;

    cout << "\nNumber Square\n";

    while (i <= 10)

    {

         cout << " " << i << "\t " << i * i << endl;

         i++;

    }

    system("pause");

    return 0;

}

You might be interested in
A fluid of specific gravity 0.96 flows steadily in a long, vertical 0.71-in.-diameter pipe with an average velocity of 0.90 ft/s
KengaRu [80]

Answer:

0.00650 Ib s /ft^2

Explanation:

diameter ( D ) = 0.71 inches = 0.0591 ft

velocity = 0.90 ft/s ( V )

fluid specific gravity = 0.96 (62.4 )  ( x )

change in pressure ( P ) = 0 because pressure was constant

viscosity =  (change in p - X sin∅ ) D^{2} / 32 V

              = ( 0 - 0.96( 62.4) sin -90 ) * 0.0591 ^2  / 32 * 0.90

              = - 59.904 sin (-90) * 0.0035 / 28.8

              = 0.1874 / 28.8

  viscosity = 0.00650 Ib s /ft^2

8 0
3 years ago
Read 2 more answers
Miles (322,000 kilometers [km]) or
slega [8]
The answer is B . have a good day
3 0
3 years ago
Read 2 more answers
A/an_ Oscilloscope uses a cathode ray tube and displays all voltages.
MrRa [10]

Answer:

I think it’s B, digital

Explanation:

3 0
3 years ago
Express the following quantities to the nearest standard prefix using no more than three digits.(a) 20,000,000 Hz(b) 1025 W(c) 0
bija089 [108]

Answer:

(a) 20 MHz

(b) 1.025 KW

(c) 3.33 ns

(d) 33 pF

Explanation:

(a) 20,000,000 Hz = 20 x 10^6 Hz = 20 Mega Hz = <u>20 MHz</u>

(b) 1025 W = 1.025 x 10^3 W = 1.025 Kilo W = <u>1.025 KW</u>

(c) 0.333 x 10^(-8) s = 3.33 x 10^(-9) s = 3.33 nano s = <u>3.33 ns</u>

(d) 33 x10^(-12)F = 33 pico F = <u>33 pF</u>

8 0
3 years ago
What is 7-?=4 i need help
aleksandr82 [10.1K]

Answer:

3

Explanation:

7-3=4

6 0
3 years ago
Read 2 more answers
Other questions:
  • Write a grammar for a language whose sentences start with an even and non-zero number of x’s, end with an odd number of z’s, and
    11·1 answer
  • The assembly consists of two red brass C83400 copper alloy rods AB and CD of diameter 30 mm, a stainless 304 steel alloy rod EF
    11·1 answer
  • Open the"stateData3.c" program and try to understand how the tokenization works. If you open the input file "stateData.txt", you
    15·1 answer
  • 2.4 kg of nitrogen at an initial state of 285K and 150 kPa is compressed slowly in an isothermal process to a final pressure of
    8·1 answer
  • Two parts are to be assembled in a way that if one part fails, the entire assembly fails. Each of the parts have undergone exten
    15·1 answer
  • What is the base unit in standard measurement
    13·2 answers
  • Hi plz delete this question i had to edit it cuz it was wrong question
    5·1 answer
  • Which source would be the best to base a hypothesis upon
    9·1 answer
  • A motor vehicle has a mass of 1200kg and the road wheels have a radius of 360mm. The engine rotating parts have a moment of iner
    5·1 answer
  • In a morphological matrix, which of the following contains the parameters that are essential to a design?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!