Program to find the absolute value of given integer using
Conditional Operators

Answer Posted / apoorv gaurav

#include<stdio.h>
int main()
{
int a;
printf("Enter any number");
scanf("%d",&a);
if(a>=0)
printf("%d",a);
printf("%d",(-1*a));
return 0;
}

Is This Answer Correct ?    7 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you understand by friend-functions? How are they used?

647


Why is c platform dependent?

623


the question is that what you have been doing all these periods (one year gap)

1621


What are the parts of c program?

638


How does pointer work in c?

621






What is sizeof array in c?

596


What is else if ladder?

610


What is hashing in c?

645


What are the different types of linkage exist in c?

613


What are the properties of union in c?

591


What is a newline escape sequence?

666


What are the 5 types of inheritance in c ++?

586


How do you construct an increment statement or decrement statement in C?

745


I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...

9658


Write the test cases for checking a variable having value in range -10.0 to +10.0?

1818