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
How can you check to see whether a symbol is defined?
Why can’t constant values be used to define an array’s initial size?
What will be your course of action for a push operation?
What is sizeof c?
What are the uses of a pointer?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What are the advantages and disadvantages of pointers?
why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???
Why static is used in c?
Do you know the use of 'auto' keyword?
Why use int main instead of void main?
If the size of int data type is two bytes, what is the range of signed int data type?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Write a program to check armstrong number in c?
How can I get random integers in a certain range?