+ 1

How to write scanf(“%f”, &a); on C++

I tried to write cin>>&a; But it’s wrong

25th Dec 2018, 10:04 AM
Santa Murphy
Santa Murphy - avatar
2 Answers
+ 3
In c++ no need the “&”! Just use cin >> a;
25th Dec 2018, 10:10 AM
Sekiro
Sekiro - avatar
+ 10
float a; cin >> a; // In C++, we don't need to specify the access specifiers like %d, %f, %c, etc. And also we don't need to use '&' symbol while taking input from the user.
25th Dec 2018, 10:15 AM
Nova
Nova - avatar