added a number that it likes

This commit is contained in:
Return0ne 2021-07-24 11:41:20 -04:00
parent 9ce07151d1
commit d143904c1d
2 changed files with 29 additions and 24 deletions

View File

@ -1 +1 @@
Learn stuffies add a file that has the number that someone typed aswell as their name

View File

@ -1,23 +1,28 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
void NumberInput() { void NumberInput() {
int UsrNum; // this makes a variable int UsrNum; // this makes a variable
cout << "Type your favorite number will ya: "; cout << "Type your favorite number will ya: ";
cin >> UsrNum; // this gets checks for user input and loads it into UsrNum cin >> UsrNum; // this gets checks for user input and loads it into UsrNum
cout << "Ew I hate the number " << UsrNum << endl; // this displays the number in UsrNum and then to go down a line //if the number you typed is 69 then it displays Nice in the command line if not then it says it hates that number
} if (UsrNum==69){
cout << "Nice \n";
void PrgEnd() { } else {
string Name; // this makes a string called name cout << "Ew I hate the number " << UsrNum << endl; // this displays the number in UsrNum and then to go down a line
cout << "To exit the program please type your name: "; }
cin >> Name; // this gets what you typed }
cout << "Thanks for playing: " << Name;// this displays what you type
} void PrgEnd() {
string Name; // this makes a string called name
int main() { cout << "To exit the program please type your name: ";
NumberInput(); // this runs the NumberInput function cin >> Name; // this gets what you typed
PrgEnd(); cout << "Thanks for playing: " << Name << endl;// this displays what you type
return 0;// this tells all the functions and code to go back to main aka the start }
}
int main() {
NumberInput(); // this runs the NumberInput function
PrgEnd(); // this runs the PrgEnd function
return 0;// this tells all the functions and code to go back to main aka the start
}