write a program to find the largest of two numbers without
using for,while,switch,if else, conditional operator and do
while using c++ pgmng language

Answers were Sorted based on User's Feedback



write a program to find the largest of two numbers without using for,while,switch,if else, conditi..

Answer / random

double largest(double x, double y){
return (x+y)/2. + abs(x-y)/2.;
}

Is This Answer Correct ?    28 Yes 9 No

write a program to find the largest of two numbers without using for,while,switch,if else, conditi..

Answer / vishal sharma

double largeone(double a,double b)
{
return(((a+b)/2) + ((a-b)/2));
}

Is This Answer Correct ?    9 Yes 2 No

write a program to find the largest of two numbers without using for,while,switch,if else, conditi..

Answer / swaroop

int max,a,b;
max = (a>b)? a:b ;

Is This Answer Correct ?    8 Yes 10 No

Post New Answer

More OOPS Interview Questions

What is command routing in MFC

1 Answers   GE,


Can a varargs method be overloaded?

0 Answers  


How is class defined?

0 Answers  


Which language is pure oop?

0 Answers  


What is the use of unnamed namespaces in OOPS? The only advantage I know is that they dont need the scope resolution operator while accessing them. I want to know some other advantages of unnamed namespaces...

2 Answers  






what are the ways in which a constructors can be called?

0 Answers  


inheritence with example

1 Answers  


Have you ever interfaced with a database?

2 Answers   IBM,


What is Agile methodology?

20 Answers   ABC, Accenture, College School Exams Tests, Inmar, Microsoft, Sapient,


What is pure oop?

0 Answers  


What is abstraction example?

0 Answers  


what is virtual function?

3 Answers  


Categories