C Project – Guess a Random Number in with Source Code
Get Certified in C Programming and Take Your Skills to the Next Level
Program 1
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
int main()
{
int me,you,count=5,i=1,f=0;
system("cls");
srand(time(NULL));
me=rand()%100;
//printf("%d",me);
while(i<=5)
{
printf("\n Enter a number for guess.. you left %d chance",count);
scanf("%d",&you);
if(me==you)
{
printf("\n\nGreat... You win game is over now...");
f=1;
break;
}
else
if(you>me)
printf("\n\n Hint.. no is Grater.....");
else
printf("\n\nHint ..no is Less.....");
count--;
i++;
}
if(f==0)
printf("**********Oops you loss all chances*********");
return 0;
}
Your opinion matters
Please write your valuable feedback about DataFlair on Google

