#include <stdio.h> #include <stdlib.h> #include <time.h> int main() { srand(time(NULL)); int randNum = rand()%100,userNum=0; printf("Guess the hidden number between 0 and 99:"); scanf("%d",&userNum); if(userNum == randNum) { printf("Congratulations! You guessed correctly!"); } else { printf("Sorry... Wrong answer\n"); printf("Better luck next time\n"); } }
We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy. Accept Learn more