1.

Define ABS function with example.

Answer»

ABS(X): This function gives the absolute value of X. The absolute value of a constant is always independent of its sign le., it is always positive.
For example:

#include<stdio.h>
#include<conio.h>
void main()
{
int a = -20, b = -20.23, c = 18.5
printf (“%d %d %d”, abs(a), abs(b), abs(c));}

Output: 20 20.23 18.5



Discussion

No Comment Found