How does it work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How does it work?

It's answer is 2 tell me how #include<iostream.h> void f(int) { cout<<"1"; } void f(double) { cout<<"2"; } void f(float) { cout<<"3"; } int main() { f(1.0); }

17th Jan 2020, 4:31 PM
Umair Ali
Umair Ali - avatar
5 Answers
+ 4
A floating point literal by default is a `double`, except a notation was added to define it as a `float` e.g. 1.0f The function accepting double parameter is thus the one that be invoked.
17th Jan 2020, 4:35 PM
Ipang
+ 3
It's C++ not java
5th Feb 2020, 5:00 PM
Umair Ali
Umair Ali - avatar
+ 2
it true f(1,0)
17th Jan 2020, 5:02 PM
Golooba Zubairi
Golooba Zubairi - avatar
+ 2
for which code foating point
20th Jan 2020, 2:48 PM
Golooba Zubairi
Golooba Zubairi - avatar
+ 2
no function is at extrem in float expt ot java
5th Feb 2020, 4:54 PM
Golooba Zubairi
Golooba Zubairi - avatar