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
What does #pragma once mean?
Do you know the difference between malloc() and calloc() function?
What are qualifiers in c?
Difference between macros and inline functions? Can a function be forced as inline?
Write a factorial program using C.
What is scope of variable in c?
What is the difference between text files and binary files?
What is the use of sizeof () in c?
What are the two types of functions in c?
How can you tell whether a program was compiled using c versus c++?
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.
What are different types of variables in c?
string reverse using recursion
what is the role you expect in software industry?
Which is better between malloc and calloc?