Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is volatile variable in c with example?

994


How many bytes are occupied by near, far and huge pointers (dos)?

1115


What is identifier in c?

962


What is double pointer in c?

983


Why string is used in c?

952


How can I write functions that take a variable number of arguments?

1075


What does %d do?

1203


What do you mean by dynamic memory allocation in c?

1045


ATM machine and railway reservation class/object diagram

5191


Which node is more powerful and can handle local information processing or graphics processing?

1255


How can I read/write structures from/to data files?

921


What do you mean by keywords in c?

1079


What is keyword with example?

1008


What is #include cctype?

1070


What are the header files used in c language?

990