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 / 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 is const keyword in c?

1128


Why does the call char scanf work?

1168


How pointer is different from array?

1028


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

997


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1032


Explain two-dimensional array.

1021


Is there any data type in c with variable size?

1045


Explain how do you declare an array that will hold more than 64kb of data?

1403


define string ?

1061


What is extern variable in c with example?

964


Why main function is special give two reasons?

1499


What is n in c?

981


What are the types of bitwise operator?

1057


What does 2n 4c mean?

1196


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

1126