Mega Code Archive
Categories
/
C
/
Code Snippets
Return absolute value of integer parameter how to use abs
#include
#include
int main () { int j, k; j = abs( 3 ); k = abs( -1 ); printf (" j = %d \n", j); printf (" k = %d\n", k); return 0; }