#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
double num1 = -1, num2 = -1, num3 = -1;
while(num1 < 0 || num1 > 10)
{
cout << "Hey there! I'd like you to choose a number between 1 & 10" << endl;
cin >> num1;
if (num1 < 0 || num1 > 10)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num1 << endl;
while (num2 < 0 || num2 > 10)
{
cout << "This time I want you to choose another number between 1 & 10" << endl;
cin >> num2;
if (num2 < 0 || num2 > 10)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num2 << endl;
while (num3 < 0 || num3 > 50)
{
cout << "This time I want you to choose another number between 1 & 50" << endl;
cin >> num3;
if (num3 < 0 || num3 > 50)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num3 << endl;
cout << num1 * num2 / num3 << endl;
cout << "We have calculated the values." << endl;
cin;
return 0;
}
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
int main()
{
double num1 = -1, num2 = -1, num3 = -1;
while(num1 < 0 || num1 > 10)
{
cout << "Hey there! I'd like you to choose a number between 1 & 10" << endl;
cin >> num1;
if (num1 < 0 || num1 > 10)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num1 << endl;
while (num2 < 0 || num2 > 10)
{
cout << "This time I want you to choose another number between 1 & 10" << endl;
cin >> num2;
if (num2 < 0 || num2 > 10)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num2 << endl;
while (num3 < 0 || num3 > 50)
{
cout << "This time I want you to choose another number between 1 & 50" << endl;
cin >> num3;
if (num3 < 0 || num3 > 50)
cout << "The value you have input was not within the scope specified." << endl;
}
cout << "The number you have chosen is: " << num3 << endl;
cout << num1 * num2 / num3 << endl;
cout << "We have calculated the values." << endl;
cin;
return 0;
}
using namespace std;
// Instead of cout << "" << endl;
printf("contents");
using namespace std;
// Instead of cout << "" << endl;
printf("contents");
Copyright © 2024, NextGenUpdate.
All Rights Reserved.