Answers for "c absolute value"

C
2

how to absolute value in c

int abs(int x);
Posted by: Guest on October-20-2020
0

c absolute value

#include <stdio.h>
#include <stdlib.h>

int main() 
{
	int a;
	printf("ABSOLUTE VALUE\n\nNumer: ");
	scanf("%d",&a);
    
	if(a < 0)
	{
		a = a * (-1);
	}
    
	printf("Absolute value: %d\n\n", a);
    
	system("pause");
}
Posted by: Guest on February-11-2021

Code answers related to "C"

Browse Popular Code Answers by Language