+ 4
Can't understand what are you trying to do ,but you need to pass address of a like &a to scanf function where the value will be stored
16th Oct 2020, 6:06 PM
Abhay
Abhay - avatar
0
You got already explanation, if it is still unclear to you then check this corrected code... #include<stdio.h> int main() { int a ; printf("add the number\n"); scanf("%d\n", &a); printf("the squared number is\n"); printf("%d",a*a); return 0; }
16th Oct 2020, 8:28 PM
Jayakrishna 🇼🇳
0
You are getting a number stored as variable a .then you are going to square the number you got.finally you have to print the squares number.here the mistake you made is you should use printf to display the result.
17th Oct 2020, 5:08 AM
joffie
joffie - avatar