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

Program to find larger of the two numbers without using if-else,while,for,switch

Answer Posted / nidhish mathew

#include<stdio.h>
#include<math.h>
int main()
{
int i,j;
scanf("%d%d",&a,&b);
printf("Greater Number is %d",(a+b+abs(a-b))/2);
printf("Smallest Number is %d",(a+b-abs(a-b))/2);
}

Is This Answer Correct ?    16 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the applications of c language?

1073


How is a pointer variable declared?

1081


Can I initialize unions?

1037


What is the difference between a free-standing and a hosted environment?

1142


Write a c program to demonstrate character and string constants?

2186


What is a lvalue

1079


Why clrscr is used after variable declaration?

1682


Define macros.

1263


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

1070


hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?

2123


what are the 10 different models of writing an addition program in C language?

1891


Explain what does it mean when a pointer is used in an if statement?

1061


Explain logical errors? Compare with syntax errors.

1068


What is the purpose of 'register' keyword in c language?

1020


How many parameters should a function have?

1185