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, 3 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 27 Apr 2017 My Price 8.00

Display description of program

I need help with my code this is what I am m trying to do :

Display description of program

Prompt the user for the first number

Prompt the user for the second number

If first number equals second number

    Display the two numbers are equal

Else

    If first number is greater than second number

        Assign second number to smallest

    Else

        Assign first number to smallest

    End-If

    Display smallest number

End-If

 

 

This is what I have:

#include <iostream>

using namespace std; // This program is used to determine which numerical value is higher. The user enters the numbers and the program decides which is larger
void main ()
{
 cout << " This program allows you to input numbers and will determine which one has the higher value.";
 
 cout<< " Please enter your first number.";
 [default= " << number <<"] :";
 ("pause");
 cout<< "Please enter your second number.";
 int num2 = 7 ;
 ("pause");
 if (num1 == num2){
  cout << "Both numbers are equal to each other" << endl;
 }else if (num1 > num2){
  cout << "The smallest value is " << num2 << endl;
 }else {
  cout << "The smallest value is " << num1 << endl;
  system("pause"); 
 } 

}

Answers

(11)
Status NEW Posted 27 Apr 2017 12:04 AM My Price 8.00

-----------

Not Rated(0)