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...

write a c program for greatest of three numbers without
using if statment

Answer Posted / sathishmani

void main()
{
int a=10,b=20,c=30,d;
d=((a>b)&&(a>c))?1:2;
switch(d)
{
case 1:
printf("%d",a);
break;
case 2:
d=(b>c)?b:c;
printf("%d",d);
break;
}
}

Is This Answer Correct ?    68 Yes 21 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always defined as 0(zero)?

1099


Explain what is meant by 'bit masking'?

1193


a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode

1112


How do I send escape sequences to control a terminal or other device?

1070


Explain what is page thrashing?

1091


When is a null pointer used?

1108


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

1068


What the different types of arrays in c?

1058


explain what are pointers?

1011


In which layer of the network datastructure format change is done

1881


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

3963


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1544


what is recursion in C

1060


Is it possible to have a function as a parameter in another function?

1073


How can I dynamically allocate arrays?

1089