I seriously don't know what is wrong. It may be something very simple, but I can't find the error. I wrote this very simple program in C:
#include<stdio.h>
int main(void) {
int n;
scanf("%d", &n);
printf("\n%d", &n);
return 0;
}
But when I ran it, this is what I got:
1 // My input
-1936471972
What am I doing wrong?
Thanks in advance!
printf("\n%d", &n)<=== should ben, not&nn, not its value.newlineat the end of the format string, likeprintf("%d\n", n);This will pay off big time when you useprintffor debugging cues.