C Project – Number Guessing Game
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
// Project for Guess randmom number
#include<stdio.h>
#include<conio.h>
#include<time.h>
#define clrscr() system("cls")
int main()
{
clrscr();
int me,you,i=1,count=10;
srand(time(NULL));
me=rand()%100;
while(i<=10)
{
printf("\n Enter a number : %d chance left",count);
scanf("%d",&you);
if(me==you)
{
printf(" ************ Great You win the game*************");
break;
}
if(you>me)
printf("\n Your number is grater than my number: ");
else
printf("\n Your number is less than my number: ");
count--;
i++;
}
if(count==0)
printf("\n Oops you failed to enter correct number Game is over now you loss the game.... ");
return 0 ;
}
We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

