The code works but it will complain about implicit declaration of abs() function because the system header file for it hasn't been called. abs() is found in the stdlib.h header file.
Working code with no complaints:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a=-1;
printf("abs(a) = %i",abs(a));
return 0;
}