How to do absolute value in C programming?

I need to Write a program that asks the user to enter a single number. Then print the absolute value of that number. I have errors in my program. Im not sure what I did wrong #include <stdio.h> int main() double theNumber; double result = abs(theNumber); { printf ( abs(result)); return 0; } show more I need to Write a program that asks the user to enter a single number. Then print the absolute value of that number.

I have errors in my program. Im not sure what I did wrong


#include <stdio.h>

int main()
double theNumber;

double result = abs(theNumber);
{
printf ( abs(result));

return 0;
}
5 answers 5