My program is not working when I use scanf function
Sololearn Code: #include <stdio.h> /* declaration */ int square (int num); int main() { int x, result; x = 5; result = square(x); printf("%d squared is %d\n", x, result); return 0; } /* definition */ int square (int num) { int y; y = num * num; return(y); } Modified by me using scanf() funcation #include<stdio.h> //Declaration// int square (int num); int main() { int x; int result; result= square (x) ; scanf("%d", &x); printf ("%d Square is %d\n", x, result); return 0; } // Declearation // int square (int num) { int y; y= num * num; return (y); }