Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- using namespace std;
- int main(int argc, char** argv) {
- cout << "Hello my name is Felix and i'm the best" << endl;
- int rand_num = rand() % 20 + 1;
- int user_guess;
- do
- {
- cout << "Guess number between 1 to 20: ";
- cin >> user_guess;
- if(user_guess == rand_num)
- {
- cout << "you guessed it right!" << endl;
- }
- }while(user_guess != rand_num);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement