Have a question?
Message sent Close

CIS170C Programming Please Enter A Numerical Value DeVry University

0
0 reviews
  • Description
  • Full Document
Blur-Preview

DeVry University

CIS170C Programming Please Enter A Numerical Value DeVry University

(1) Code
// —————————————————————
// Programming Assignment: LAB02A
// Developer: STUDENT
// Date Written: 07/11/2017
// Purpose: Smallest Number Program
// —————————————————————
#include<iostream>
using namespace std;
int main()
{
//Declare variables
int num1, //First number
num2; //Second number
cout << “Program to Determine Smallest Number\n”;
cout << “————————————” << endl;
cout << “Please enter a numerical value: “;
cin >> num1;
cout << “Please enter a numerical value: “;
cin >> num2;
if (num1 == num2) //Determine if the two numbers are equal
{
cout << “The two number are equal! ” << endl;
}
else if (num1 > num2) //Determine if the 1st number is greater than the 2nd number
{
cout << “The smallest value is ” << num2 << endl;
}
else
{
cout << “The smallest value is ” << num1 << endl;
}
cout << “Press any key to continue.” << endl;
cin.get();
cin.get();
return 0;
}
(2) Screenshot
Copy and paste a screenshot of the program working. If there are multiple parts to the lab, please label
each part. The screenshot should show the entirety of the program.
Equal

Preview

CIS170C Programming Please Enter A Numerical Value DeVry University

NOTE: Please check the details before purchasing the document.

error: