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 does #pragma once mean?

1111


Do you know the difference between malloc() and calloc() function?

1005


What are qualifiers in c?

983


Difference between macros and inline functions? Can a function be forced as inline?

1201


Write a factorial program using C.

1017


What is scope of variable in c?

991


What is the difference between text files and binary files?

1283


What is the use of sizeof () in c?

993


What are the two types of functions in c?

943


How can you tell whether a program was compiled using c versus c++?

1044


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

1215


What are different types of variables in c?

1009


string reverse using recursion

2374


what is the role you expect in software industry?

2085


Which is better between malloc and calloc?

1120