+ 1
Why is scanf not working in c compiler
14 ответов
+ 9
It will be better if you share the code where you are facing problem ✌
Read this first please
https://www.sololearn.com/Discuss/333866/?ref=app
+ 2
Can you specify a example, when it is not working?
+ 2
It works. You are taking the input, after that you are doing nothing, then how can you make sure it is working or not working correctly?
print the input value after scanf...
+ 2
What input you are given?
If you don't give any value, it prints 0. If you enter an integer number then it print that number..
Input ex: as 9 it prints 9..
+ 2
Abhishek Malav ,
Checkout the attached code below (about providing code input in SoloLearn), and see through it that you provide a value when the input dialog pops up asking for input.
And make sure to create and save that snippet as C code rather than C++ code (in Code Playground). `scanf` does not work if you save that into C++ code. There's a trick to get `scanf` to work for C++ in Code Playground, but that is an entirely different discussion topic : )
https://code.sololearn.com/WhiNb9BkJUVC/?ref=app
+ 1
Okay i printed a after that and output it shows is 0
+ 1
#include <stdio.h>
int main() {
int a;
printf("enter the value");
scanf("%i",&a);
printf("%i",a);
}
+ 1
Okay thank u so much, i gotta figure it out.....thanx
+ 1
I think you wanted to:
#include <stdio.h>
int main() {
int a;
printf("Enter the value");
scanf("%d", &a);
printf ("%d", a);
return 0;
}
0
#include <stdio.h>
int main() {
int a;
printf("enter the value");
scanf("%i",&a);
}
0
But the problem is its not asking for values....it just gives the output:
enter the value0
0
It running fine on other compiler but not over here
0
👍
0
How can I be genius in python