Program to find the absolute value of given integer using
Conditional Operators
Answer Posted / ravi vishwakarma
#include<stdio.h>
#include<conio.h>
void main()
{
int m;
printf("enter the value of m:");
scanf("%d",&m);
(m>=0?printf("%d",m):printf("%d",-(m)));
getch();
}
| Is This Answer Correct ? | 38 Yes | 6 No |
Post New Answer View All Answers
What is the importance of c in your views?
What functions are used for dynamic memory allocation in c language?
What is return in c programming?
What is maximum size of array in c?
What is scope of variable in c?
How can I automatically locate a programs configuration files in the same directory as the executable?
What is bin sh c?
Simplify the program segment if X = B then C ← true else C ← false
How are strings stored in c?
What is string constants?
What is class and object in c?
Differentiate between null and void pointers.
How can you access memory located at a certain address?
What is the difference between union and anonymous union?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?