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
When should volatile modifier be used?
What library is sizeof in c?
c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above
How can I call fortran?
What do you mean by keywords in c?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
What is echo in c programming?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
What is omp_num_threads?
Is c still relevant?
i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none
Are negative numbers true in c?
What is the difference between a free-standing and a hosted environment?
What is nested structure in c?
Is sizeof a keyword in c?