biggest of two no's with out using if condition statement

Answer Posted / saravanan marimuthuraja

#include <stdio.h>
#include <math.h>
void main()
{
int m1,m2,a,b;
clrscr();
printf("Enter the First Number\n");
scanf("%d",&a);
printf("Enter the Second Number\n");
scanf("%d",&b);
m1=abs((a+b)/2);
m2=abs((a-b)/2);
printf("The Bigest No is==%d\n",m1+m2);
printf("The Smallest No is==%d\n",m1-m2);
}

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many loops are there in c?

575


How are pointers declared in c?

592


Are the variables argc and argv are always local to main?

569


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

1368


can anyone please tell about the nested interrupts?

1674






What is the use of ?

619


Tell me when is a void pointer used?

644


Why do we use main function?

630


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

1567


what is the c source code for the below output? 5555555555 4444 4444 333 333 22 22 1 1 22 22 333 333 4444 4444 5555555555

2528


What is far pointer in c?

806


What is the equivalent code of the following statement in WHILE LOOP format?

763


develop algorithms to add polynomials (i) in one variable

1736


Why are all header files not declared in every c program?

598


How do we make a global variable accessible across files? Explain the extern keyword?

1416