Program to find the absolute value of given integer using
Conditional Operators
Answer Posted / vignesh1988i
#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 ? | 37 Yes | 38 No |
Post New Answer View All Answers
How can I write functions that take a variable number of arguments?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
If you know then define #pragma?
How is a pointer variable declared?
Is array name a pointer?
What is the difference between class and object in c?
What is assert and when would I use it?
What is adt in c programming?
What are the types of unary operators?
What is the use of a ‘ ’ character?
What is calloc() function?
What is extern variable in c with example?
Explain how can I prevent another program from modifying part of a file that I am modifying?
I came across some code that puts a (void) cast before each call to printf. Why?
What is size of union in c?