Hello. I have a problem with this tiny C program.
It should print the square value of n, but it prints gargabe in the second 'printf'. Any suggestion?
| Code: |
|
#include <stdio.h> int main() { int n; printf("Enter a number: "); scanf("%d", n); printf("The result is %d.\n", n * n); return 0; } |
It should print the square value of n, but it prints gargabe in the second 'printf'. Any suggestion?
