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]
3 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]3 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 hub a signal that refreshes the signal strength.
vekshin1

Answer:You are a network engineer. While moving a handheld wireless LAN device, you notice that the signal strength increases when the device is moved from a ...

Explanation:

7 0
3 years ago
Both carpenters and building inspectors have been associated with the personality characteristics identified as realistic, conve
Inessa05 [86]

Answer:

Inspectors use inductive reasoning on the job.

Explanation:

I just took the test.

8 0
3 years ago
A steel plate has a hole drilled through it. The plate is put into a furnace and heated. What happens to the size of the inside
djverab [1.8K]

Answer:

The diameter increases

Explanation:

The expansion in the metal is uniform in every dimension

4 0
3 years ago
How do you put air knight in slingshock mode.
Nesterboy [21]

Answer:

I am not sure I am understanding plz more context

Explanation:

3 0
3 years ago
Cynthia is producing a sculpture using material introduced in the Bronze Age. What two metals is she mixing?
Airida [17]
The correct answer
would be d
Iron and carbon
hope this helps
5 0
3 years ago
Other questions:
  • Define the Problem
    11·1 answer
  • The Review_c object has a lookup relationship up to the Job_Application_c object. The job_Application_c object has a master-deta
    7·1 answer
  • Water is contained in a rigid vessel of 5 m3 at a quality of 0.8 and a pressure of 1 MPa. If the pressure is reduced to 270.3 kP
    9·1 answer
  • The convection heat transfer coefficient for a clothed person standing in moving air is expressed as h 5 14.8V0.69 for 0.15 , V
    12·2 answers
  • The goal of the following model is generate a clock waveform that has the clock high 4 time units and low 4 time units, with the
    15·1 answer
  • Is a compass a analog or a digital sensor?
    14·1 answer
  • For two different air velocities, the Nusselt number for two different diameter cylinders in cross flow is the same. The average
    6·1 answer
  • A cross beam in a highway bridge experiences a stress of 14 ksi due to the dead weight of the bridge structure. When a fully loa
    14·1 answer
  • 3
    6·1 answer
  • which acpi power state allows a system to start where it left off, but all other components are turned off? sleeping mechanical
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!