a
Number Guessing Game using C Language - C
Number Guessing Game We will make an interesting Game to understand C Language properly and to motivate us to code C language In this Interesting Game, we have to Guess the Correct number We have used loops in code we will use clion to Code our Game Clion This is the code given below for the Number Guessing Game #include<stdio.h> #include<stdlib.h> #include<time.h> int main(){ int number, guess, nguesses=1; srand(time(0)); number = rand()%100 + 1; // Generates a random number between 1 and 100 // printf("The number is %d\n", number); // Keep running the loop until the number is guessed do{ printf("Guess the number between 1 to 100\n"); scanf("%d", &guess); if(guess>number){ printf("Lower number please!\n"); } ...
0 comments:
Post a Comment