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
Explain what is the purpose of "extern" keyword in a function declaration?
What are the various types of control structures in programming?
What is sorting in c plus plus?
What is NULL pointer?
List the variables are used for writing doubly linked list program.
What does the c in ctime mean?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What does the format %10.2 mean when included in a printf statement?
What is c standard library?
What is the scope of global variable in c?
What does 3 mean in texting?
How can I generate floating-point random numbers?
What is action and transformation in spark?
What is difference between Structure and Unions?