Sunday, 12 July 2015

Solution Of 5th Program

GUESSING  GAME

I hope this is the first guessing game u have ever made with c++


#include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
    char a;
    int tries=1;
do
{
    cout<<"Enetr Any alphabte from A to Z : ";
    cin>>a;
    if(a=='b'||a=='B')
    {
    cout<<"U win the game ";
    break;
    }
else
    {
    cout<<"U loss.Try again \n";
    tries++;
    }
}while(tries<=3);
getch();
}

No comments:

Post a Comment