Average C I/O
// Read the numbers.
int n1, n2, n3;
printf("Enter Three Integers: ");
scanf("%d %d %d", &n1, &n2, &n3);
// Compute the sum and average.
double sum = n1 + n2 + n3;
printf("Mean %d %d %d is %f\n", n1, n2, n3, sum/3.0);
The primary calls for formatted I/O are scanf and printf.
The first parameter for each is a string format which describes the
layout. The % is followed by a letter indicating the type.
The format items apply to the data follwing the format in the
same order. For scanf, the user must send pointers so that the
system can update the variables.