0% found this document useful (0 votes)
5 views1 page

Number Guessing Game in C Code

Uploaded by

1ceylinesmer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Number Guessing Game in C Code

Uploaded by

1ceylinesmer
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

#include <stdio.

h>

#include <stdlib.h>

#include <time.h>

int main() {

int sayi, cemre,x;

int i;

srand(time(NULL));

sayi=rand()%100+1;

for(i=1; i<=10; i++){

printf(" ROUND %d \n",i);

printf("Write your guess: ");

scanf("%d", &cemre);

if(sayi==cemre){

printf("CORRECT GUESS \n The number was=%d",sayi);

break;

}else if(cemre<sayi){

printf("-The number is greater than yours \n");

}else{

printf("-The number is less than yours \n");

if(i==10){

printf("YOU LOST THE GAME \n The number was=%d",sayi);

You might also like