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
Is there a way to compare two structure variables?
Tell me when is a void pointer used?
Write a program to check whether a number is prime or not using c?
What is malloc calloc and realloc in c?
What is the difference between c &c++?
what is reason of your company position's in india no. 1.
What is optimization in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
Are negative numbers true in c?
How many types of errors are there in c language? Explain
Give basis knowledge of web designing ...
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Where is volatile variable stored?
What is the use of putchar function?
What are void pointers in c?