I NEED HELP. IM GETTING DOUBLE INPUTS #include <stdio.h> int main() { int g_num=7; int num; int attempts; printf("please guess the number.\n"); for(attempts=5; attempts >= 0; attempts--){ scanf("%d \n", &num); if (num==g_num){ printf("Congratulations \n You have won!!! \n"); break; } else if (num != g_num){ printf("Sorry, your guess was wrong. Please try again \n"); printf("you have %d attempts left \n", attempts); } } return 0; }
2/21/2021 11:21:48 PM
othneillo3 Answers
New AnswerSololearn Inc.
535 Mission Street, Suite 1591Send us a message