C++ Guessing Game

#include<iostream>
#include<cstdlib>
using namespace std;
int main()
{
    int a, b;
    while(1)
    {
        cout << "Enter Your Guess Number Between 0 to 5 :: ";
        cin >> a;
        cout << endl;

        b = rand()%6;

        if(a == b)
        {
            cout << "You Win...." << endl;
        }

        else
        {
            cout << "You Lost -_- " << endl << endl;
            cout << "Random Number Was :: " << b << endl;
        }
        cout << endl << endl;
    }
    return 0;
}

Comments