-
Newbie Question
I am starting to learn how to program in C and i came across and sample script and it doesn't seem to be working, here is the sample script:
#include <stdio.h>
int main(void){
int a, b;
printf("Enter two numbers: ");
scanf("%1 %1", &a, &b);
printf("%1 - %1 = %1\n", a, b, a - b);
return 0;
}
I am able to compile it fine, but when i run it and enter two numbers instead of it doing the calculation and printing it out it just prints out:
%1 - %1 = %1
Can anyone tell me why it is doing that or how to fix it. Thank you in advance.
-
Is this post invisible or what
http://cboard.cprogramming.com/showthread.php?t=25765
They're called programs, not scripts.
And all those 1's should be lower-case i
-