ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 03 May 2017 My Price 9.00

Display all the numbers from n1 to n2

  • Display all the numbers from n1 to n2.
  • Display all even numbers from n1 to n2.
  • Compute the sum of numbers from n1 to n2.
  • Compute n1! Only if n1 is <= 8 and >= 0.
  • Display numbers from n2 to n1.
  • End  the program.

 

int main()

{

     // declare variables:

int n1, n2;

int option = 0;

// declare more variables as needed.

 

// Prompt the user for two whole numbers such that n1 < n2.

     Validation: Keep prompting the user until the user enters 2 numbers in proper order.

                 

               // Display the menu of options (see above).

               // Prompt the user to select an option. Read it into variable option.

 

               // Use  switch statement to process the selected option.    

               // Option-1:  Write a while loop to display numbers n1 to n2.

               // Option-2: Write a for loop to display the even numbers from n1 to n2.

               // Option-3: Write a for loop to add up all the numbers from n1 to n2. Display the sum.

               // Option-4:  if n1 is less than 9 and greater than 0, write a for loop to compute n1factorial.

                                    NOTE:  n1 factorial is 1 * 2 * 3 ….* n1. By definition 0! Is equal to 1.

                // Option-5: Display numbers in reverse order, n2 to n1.                                  

                // Option-6: Thank the user and end the program.

                // default: Invalid option.

 

       _getch();

        return 0;

      }

Attachments:

Answers

(11)
Status NEW Posted 03 May 2017 04:05 AM My Price 9.00

-----------

Attachments

file 1493785495-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)