biggest of two no's with out using if condition statement
Answer Posted / k.anand
#define myabs(a,b) a>b?(a-b):(b-a)
int main()
{
int a,b;
int biggest=0;
scanf("%d%d",&a,&b);
biggest=(a+b+myabs(a,b))/2;
printf("%d",biggest);
}
| Is This Answer Correct ? | 6 Yes | 7 No |
Post New Answer View All Answers
What is a constant?
What is null in c?
What is the purpose of type declarations?
how should functions be apportioned among source files?
What is the easiest sorting method to use?
What are all different types of pointers in c?
FILE *fp1,*fp2; fp1=fopen("one","w") fp2=fopen("one","w") fputc('A',fp1) fputc('B',fp2) fclose(fp1) fclose(fp2)} a.error b. c. d.
In a byte, what is the maximum decimal number that you can accommodate?
Does c have function or method?
What is wrong with this program statement?
Is exit(status) truly equivalent to returning the same status from main?
Write a program to check whether a number is prime or not using c?
Difference between linking and loading?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
What is the use of printf() and scanf() functions?