given two numbers.how can you find the biggest of the two,without using conditional statements,relational operarors or ternary operators
C programming?
The mathematical formula is:
max(a,b)= (a + b + |a-b|)/2
in C:
long max(long a, long b){
return (a +b + abs(a-b))/2;
}
Reply:double big, firstnumber,secondnumber;
big=max(firstnumber,secondnumber);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment