C语言abs函数

C语言编程入门教程 - abs 函数是用来求整数的绝对值的。

//函数名:abs
//功  能:求整数的绝对值
//用  法:int abs(int i);
//程序例:
#include<stdio.h>
#include<math.h>
int main(void)
{
 int number = -1234;
 printf("number: %d absolute value: %d\n", number, abs(number));
 return 0;
}

猜你喜欢

转载自www.cnblogs.com/xiaxue168/p/10373967.html
ABS