I recently started taking a C course and I am having some difficulties running a simple I/O program:
#include <stdio.h>
int main()
{
int age;
printf("Please enter your age: ");
scanf("%d\n", age);
printf("Your age is: %d", age);
return 0;
}
the problem is that the program does start running, but it never stops and it doesn't allow me to type in the age and doesn't even print out the "Please enter your age: " sentence. I have a gcc, g++ and a gdb installed and everything works fine if I remove the "scanf".
I would really appreciate some help! Thank you!