#include <iostream.h>
#include <conio.h>
#include <stdio.h>
int main() {
int number=0;
int rand_number=0;
clrscr();
cout << "Enter Number " ;
cin >> number;
rand_number = rand(); // rand() is a C++ function that generates random numbers
cout << "Random number = " << rand_number << endl;
if (number == rand_number)
cout << "Congrats! you won the game";
else
cout << "Oops! You lose the Game.";
getch();
return 0;
}
#include <conio.h>
#include <stdio.h>
int main() {
int number=0;
int rand_number=0;
clrscr();
cout << "Enter Number " ;
cin >> number;
rand_number = rand(); // rand() is a C++ function that generates random numbers
cout << "Random number = " << rand_number << endl;
if (number == rand_number)
cout << "Congrats! you won the game";
else
cout << "Oops! You lose the Game.";
getch();
return 0;
}