I was wondering why the following program doesn't function properly:
It will output: One. No matter what number you input.Code:#include <stdio.h> int main() { int a; printf("Enter a number: "); scanf("%d", a); if (a = 1) { printf("One.\n"); } else { printf("Not one.\n"); } getchar(); getchar(); }
The crappy C-tutorial on this site is no good either, since the example of how to use it is written in C++.
Thank You.



LinkBack URL
About LinkBacks




