Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
Brain & Bones It’s a question on implicit conversion and compilation errors. That’s why the functions are named the same. void f(int a, int b) { return a + b; } Error - returning a value when return type is void. int f(double a, double b) { return a + b; } Type conversion - float returned as int. int f(int a, int b) { return a + b; } No implicit conversion or compilation errors. long long f(int a, int b) { return a + b; } Type conversion - int returned as long long. void f(int a, int b) { int c = a + b; return; } No implicit conversion or compilation errors. Albiet useless.
13th Sep 2021, 3:51 PM
DavX
DavX - avatar
+ 1
i think 2nd and 4th should be correct
13th Sep 2021, 6:38 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
Void functions should not contain ‘return’ And you cannot name all the functions the same thing.
13th Sep 2021, 3:38 PM
Brain & Bones
Brain & Bones - avatar