Find the Largest Number and Calculate Factorial in C++
Classified in Computers
Written on in
English with a size of 2.11 KB
Input three numbers and find the largest. Enter a number and display the day name of the week.
#include
#include
using namespace std;
using namespace std;
int main() {
int num1, num2, num3;
int day;
cout << "Enter three numbers: ";
cout << "Enter a number (From 1 to 7): ";
cin >> num1 >> num2 >> num3;
cin >> day;
if (num1 > num2 && num1 > num3) {
cout << "Largest number is " << num1;
} else if (num2 > num3) {
cout << "Largest number is " << num2;
} else {
cout << "Largest number is " << num3;
}
switch (day) {
case 1: cout << "Sunday"; break;
case 2: cout << "Monday"; break;
... Continue reading "Find the Largest Number and Calculate Factorial in C++" »