There were some weird things going on
I am using microsoft visual studio 2013
I have done some programming before and am somewhat experienced
I see nothin wrong with this code
PLEASE HELP
errors are:
strand is undefined
cannot open stdafx.h
#include <stdafx.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{
int inumber, iguess;
char y, n;
inumber = rand() % 100 + 1;
strand (time(NULL));
do
{
printf("Guess the number (1-100)");
scanf ("id, &inumber");
if (inumber < iguess) puts ("The number is lower");
if (inumber > iguess) puts("The number is higher");
} while (inumber = iguess);
puts("Congratulations/nWould you like to play again?(y\n)/n/n");
scanf("id, &y,&n");
do
{
int main();
} while (y = y);
do
{
return 0;
} while (n = n);
}
2. Remove: #include <stdafx.h>
If your compiler complains that stdafx.h is missing, right click on your project in the solution explorer and you'll find an option to select "Not using pre-compiled headers". Ensure to select that one.
Also generally speaking you should get a seed before creating a random number or the first random number will be the same every time you run the program. Also I would suggest maybe using sub functions instead of the main function.
also line 28 you don't say the return type of a function when you call it. that would be like saying: unsignedint rand()... ect.. You only need the return type for prototyping and defining functions.