Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Find the largest number from the given 2 numbers without using
any loops and the conditional operator.

Answers were Sorted based on User's Feedback



Find the largest number from the given 2 numbers without using any loops and the conditional opera..

Answer / surya

if(!(a/b)) // if a is less than b then division result will be zero.
02
{
03
cout << " b is greater than a";
04
}
05
else if (!(a-b)) // we know a is greater than or equal to b now. check whether they are equal.
06
{
07
cout << "a and b are equal";
08
}
09
else
10
cout << "a is greater than b";

Is This Answer Correct ?    9 Yes 6 No

Find the largest number from the given 2 numbers without using any loops and the conditional opera..

Answer / anji

We can compare two
values using unary
operators also

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

how 2 compile & execute c program with out using editor?

2 Answers   HP,


How reliable are floating-point comparisons?

0 Answers  


What standard functions are available to manipulate strings?

0 Answers  


How can a program be made to print the name of a source file where an error occurs?

0 Answers  


Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.

0 Answers  


How to write a program for machine which is connected with server for that server automatically wants to catch the time for user of that machine?

0 Answers   Infosys,


1)what is the error in the following stmt where str is a char array and the stmt is supposed to traverse through the whole character string str? for(i=0;str[i];i++) a)There is no error. b)There shud be no ; after the stmt. c)The cond shud be str[i]!='\0' d)The cond shud be str[i]!=NULL e)i shud be initialized to 1

4 Answers  


Why do we need volatile in c?

0 Answers  


#include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain &#1567;&#1567;&#1567;

4 Answers  


What is string concatenation in c?

0 Answers  


Explain what are the standard predefined macros?

0 Answers  


simple c program for 12345 convert 54321 with out using string

7 Answers   TCS,


Categories