Program to find the absolute value of given integer using
Conditional Operators
Answer Posted / abdur rab
#include <stdio.h>
int main ( int argc, char* argv [] )
{
int value = -10;
printf ("\n%d", ( value >= 0 ) ? value : ~(value)
+1 );
}
| Is This Answer Correct ? | 16 Yes | 18 No |
Post New Answer View All Answers
What are different types of operators?
How can I ensure that integer arithmetic doesnt overflow?
What is ponter?
What are the properties of union in c?
Explain is it better to bitshift a value than to multiply by 2?
When should a type cast not be used?
Is main an identifier in c?
how do you execute a c program in unix.
What are the differences between new and malloc in C?
Write a Program to accept different goods with the number, price and date of purchase and display them
Explain what is a pragma?
Differentiate between calloc and malloc.
What is calloc in c?
Difference between Shallow copy and Deep copy?
Why do we use c for the speed of light?