#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<iostream>
main()
{
int a,b,c,d,e,f,f1,points,ctr;
do{
system("cls");
system("color 6");
srand(time(NULL));
b=1+rand()%10;
ctr=3;
e=b;
system("cls");
do{
printf("Guess a Number: ");
scanf("%d",&a);
if(a>b)
{
printf("Lower Please!!\n");
}
if(a<b)
{
printf("Higher Please!!\n");
}
ctr--;
if( ctr==2)
{
points=15;
}
if( ctr==1)
{
points=10;
}
if( ctr==0)
{
points=5;
}
if(a == b)
{
system("color 7");
printf("\n\nExcellent You Got it!!\n");
printf("Your Score is %d\n",points);
}
}while(a!=b && ctr!=0);
if(a!=b && ctr==0)
{
system("color 4");
printf("\n\nYou did not Get it !! \n%d is the Number!!",e);
printf("Your Score is 0");
}
printf("\n\n\nTry Again ? 1=Yes 2=No");
scanf("%d",&d);
if(d==1)
{
ctr+3;
}
if(d==2)
{
break;
}
}while(1);
return(0);
}