The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 137 Weeks Ago, 5 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
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");
}
}