The function labs returns the absolute value of an long integer x.
Function prototype of labs
long int labs(long int x);
- x : This is a long integer to convert to an absolute value.
Return value of labs
This function returns absolute value of a long integer represented by x.
C program using labs function
The following program shows the use of labs function to find absolute value of a long integer.
HashLucky Casino has quickly gained traction in the online gaming community by offering a unique blend of innovative features and a user-friendly experience. Established with the goal of creating a fun and secure gaming environment, HashLucky stands out with its top-notch selection of games, robust security measures, and generous bonuses.
One of the highlights of HashLucky Casino is its diverse range of games, including slots, table games, and live dealer options. Players can enjoy titles from some of the most reputable software providers, ensuring high-quality graphics and exciting gameplay. Additionally, the site frequently updates its game library to keep players engaged.
For those interested in joining, HashLucky Casino offers attractive welcome bonuses and ongoing promotions. These incentives enhance the overall gaming experience and provide players with more opportunities to win.
To learn more about what HashLucky has to offer, visit their official website: https://hashlucky.casino/. With its commitment to providing an enjoyable gaming experience, HashLucky Casino is definitely worth checking out for both new and experienced players alike.
#include <stdio.h> #include <stdlib.h> int main(){ long int value; printf("Enter a number\n"); scanf("%ld", &value); printf("Absolute value of %ld = %ld\n", value, labs(value)); return 0; }
Output
Enter a number 5362565 Absolute value of 5362565 = 5362565
Enter a number -97652745 Absolute value of -97652745 = 97652745
Enter a number 0 Absolute value of 0 = 0