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
provide an example of the Group by clause, when would you use this clause
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
What is function pointer c?
What is malloc() function?
What are the string functions? List some string functions available in c.
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
what are bit fields in c?
What are run-time errors?
What is the meaning of 2d in c?
When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd
What is the difference between exit() and _exit() function?
How do we declare variables in c?
A c program to display count values from 0 to 100 and flash each digit for a secong.reset the counter after it reaches 100.use for loop,. pls guys hepl me.. :(
write a program to rearrange the array such way that all even elements should come first and next come odd
What is string function c?