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


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between functions abs() and fabs()?

628


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1635


How many keywords (reserve words) are in c?

626


how to make a scientific calculater ?

1569


How can a process change an environment variable in its caller?

658






What is pass by reference in c?

617


What is derived datatype in c?

639


Why header file is used in c?

582


How to implement a packet in C

2401


Where local variables are stored in c?

560


Are bit fields portable?

681


Write a program of prime number using recursion.

623


Explain what are the different file extensions involved when programming in c?

639


What is malloc return c?

603


Is multithreading possible in c?

573