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
What is const keyword in c?
Why does the call char scanf work?
How pointer is different from array?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
Explain two-dimensional array.
Is there any data type in c with variable size?
Explain how do you declare an array that will hold more than 64kb of data?
define string ?
What is extern variable in c with example?
Why main function is special give two reasons?
What is n in c?
What are the types of bitwise operator?
What does 2n 4c mean?
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