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 are the applications of c language?
How is a pointer variable declared?
Can I initialize unions?
What is the difference between a free-standing and a hosted environment?
Write a c program to demonstrate character and string constants?
What is a lvalue
Why clrscr is used after variable declaration?
Define macros.
How do I send escape sequences to control a terminal or other device?
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?
what are the 10 different models of writing an addition program in C language?
Explain what does it mean when a pointer is used in an if statement?
Explain logical errors? Compare with syntax errors.
What is the purpose of 'register' keyword in c language?
How many parameters should a function have?