+ 3

How do I assign to the input a value x in C?

I'm trying to solve a problem with C, how can I make x = input? In the problem I'm trying to solve the input is a number

29th Jan 2020, 9:12 PM
Claudio Di Maio
Claudio Di Maio - avatar
3 odpowiedzi
+ 6
For integer: int x; scanf("%d",&x); For decimal number: double x; scanf("%lf",&x);
30th Jan 2020, 8:28 AM
ISTIAQUE ZAMAN
ISTIAQUE ZAMAN - avatar
+ 6
int a; scanf("%d", &a);
29th Jan 2020, 9:15 PM
r8w9
r8w9 - avatar
+ 2
Ty
29th Jan 2020, 9:17 PM
Claudio Di Maio
Claudio Di Maio - avatar