+ 1
How to use scanf in c without any error
I was just working with c and just boom. I was blank so please can anyone tell me and give an example too please
2 Réponses
+ 3
What error are you getting? a compile error, runtime error, or unexpected result? What code do you have so far? Please post a link so we can help.
0
If we have an integer variable x, we do this:
scanf("%d", &x);
Note: remember the format characters for each type. If you want to enter the value of a float or double, use "%f" instead of "%d", and if you want to enter a string, enter "%s". There's more than that, but it should get you started.