+ 1

if given inputs are int and sum value is double. how do we do that?

10th Dec 2016, 2:06 AM
Mallareddy Avinash
Mallareddy Avinash - avatar
2 Antworten
+ 3
you should always use double as input if there is chanch of double . and converting it isn't that hard. just asign it as double value to own or create a new variable
10th Dec 2016, 2:22 AM
Sun
Sun - avatar
0
double som(int a,int b) { double c=a+b; return c; }
10th Dec 2016, 2:41 AM
Somnath Ghosh
Somnath Ghosh - avatar