Explore BrainMass

Explore BrainMass

    Control Structures II with C++ programming

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a program that uses do while loops to perform the following steps:
    1. Prompt the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).
    2. Output all odd numbers between firstNum and secondNum.
    3. Output the sum of all even numbers between firstNum and secondNum.
    4. Output the numbers and their square between 1 and 10.
    5. Output the sum of the square of the odd numbers between firstNum and secondNum.
    6. Output all uppercase letters.

    © BrainMass Inc. brainmass.com February 24, 2021, 2:37 pm ad1c9bdddf
    https://brainmass.com/computer-science/control-structures/control-structures-ii-c-plus-plus-programming-32598

    Solution Preview

    Please see attached and below.

    #include<iostream.h>

    void main( )
    {
    int firstnum;
    int secondnum;
    int sum=0;
    char letter[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O',
    'P','Q','R','S','T','U','V','W','X','Y','Z'};

    do{
    cout<< "Please enter the first number : ";
    cin>> firstnum;
    cout<< "Please enter the second number : ";
    cin>> ...

    Solution Summary

    Control Structures II with C++ programming are featured.

    $2.19

    ADVERTISEMENT