C examples for Statement:if
Calculating the Absolute Value of an Integer.
#include <stdio.h> int main (void) { int number;//from ww w. j a va 2 s. c o m printf ("Type in your number: "); scanf ("%i", &number); if (number < 0) number = -number; printf ("The absolute value is %i\n", number); return 0; }