ok so i have been working on a class assignment for 2 weeks now and i cannot get it right for some reason. I have gone over this a million times and cant get it can someone help. I have to use Pelles C, with simple codes, so bare with me.
#include <Stdio.h>
int main(int argc, char *argv[])
{
int iRandomNum = 0;
int iResponse = 0;
srand(time(NULL));
iRandomNum = (srand() % 10) + 1;
printf("\nGuess a number between 1 and 10: "0;
scanf("%d", &iResponse);
if (iResponce == iRandomNum)
printf ("\nYou Guessed Right\n");
else {
printf("\nSorry that is incorrect\n");
printf("The correct number was %d\n", iRandomNum);
}
return 0;
}
this is my code
this is what i get as results
Building main.c number game.obj.
C:\Users\User\Documents\number guessing game\main.c number game.c(10): warning #2018: Undeclared function 'srand' (did you mean 'scanf'?); assuming 'extern' returning 'int'.
C:\Users\User\Documents\number guessing game\main.c number game.c(10): warning #2018: Undeclared function 'time' (did you mean '(no name)'?); assuming 'extern' returning 'int'.
C:\Users\User\Documents\number guessing game\main.c number game.c(14): error #2001: Syntax error: expected ')' but found 'integer constant'.
C:\Users\User\Documents\number guessing game\main.c number game.c(14): error #2001: Syntax error: expected ';' but found 'integer constant'.
C:\Users\User\Documents\number guessing game\main.c number game.c(18): error #2048: Undeclared identifier 'iResponce' (did you mean 'iResponse'?).
*** Error code: 1 ***
Done.