Question
Hi i have some errors with my code if you could take a look at it thatd be great. #define _CRT_SECURE_NO_WARNINGS #include #include #include #define
Hi i have some errors with my code if you could take a look at it thatd be great.
#define _CRT_SECURE_NO_WARNINGS #include
int printRandoms(int lower, int upper) { int i;
int num = (rand() % (upper - lower + 1)) + lower; return num; }
int main() { int lower = 1, upper = 20; int n, p, i = 1, sum = 0, k, f; char q; menu: printf("1.Game Rules "); printf("2.Edit Player Details "); printf("3.Play "); printf("4.Exit "); printf("Please pick an option: ");
printf("This game aims to add up a random number in the range of 1 to 20 each turn to get a final number in the range of 40to 50 "); printf("if the players score is less than 50 after each turn they can choose to continue. "); printf("if they choose to continue, the number of turns will increase by 1. "); printf("The player also looses the game and gets 0 points if the final score is less thanafter deciding to and their turns. "); printf("if the players final score is inthe range of 40 to50, then the final point is equal to the final score subtracting the number of turns the user took to get the final score."); printf("press 0 to go back to the main menu ");
printf("press 1 to edit or 0 to go back to main menu ");
if (sum
if (q == 'y')( goto jump: ) elif (q == 's')( printf("Roburt, you have lost the game") )
}
here's the code in photo form
Executed code
Errors
Thank you for your help 1 2 3 4 5 #define _CRT_SECURE_NO_WARNINGS #include
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started