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 are different types of operators?

994


How can I ensure that integer arithmetic doesnt overflow?

1104


What is ponter?

1234


What are the properties of union in c?

1012


Explain is it better to bitshift a value than to multiply by 2?

1146


When should a type cast not be used?

1012


Is main an identifier in c?

1096


how do you execute a c program in unix.

1083


What are the differences between new and malloc in C?

1085


Write a Program to accept different goods with the number, price and date of purchase and display them

6159


Explain what is a pragma?

1004


Differentiate between calloc and malloc.

1232


What is calloc in c?

1091


Difference between Shallow copy and Deep copy?

1977


Why do we use c for the speed of light?

1115