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 is volatile variable in c with example?
How many bytes are occupied by near, far and huge pointers (dos)?
What is identifier in c?
What is double pointer in c?
Why string is used in c?
How can I write functions that take a variable number of arguments?
What does %d do?
What do you mean by dynamic memory allocation in c?
ATM machine and railway reservation class/object diagram
Which node is more powerful and can handle local information processing or graphics processing?
How can I read/write structures from/to data files?
What do you mean by keywords in c?
What is keyword with example?
What is #include cctype?
What are the header files used in c language?