/* Make an executable porgram redirection from this C code. Run it as follows: redirection < data1 Each time scanf function is called it will read a number from the file data1 Example: Let file data1 be just five numbers 1 2 3 4 5 */ #include int main() { int x, y; scanf("%d", &x); printf("First number was %d \n", x); /* Read the 2nd and the 3rd number from the file data1 */ scanf("%d %d", &x, &y); /* Notice the value of x has changed: the 2nd number replaced the 1st one */ printf("The next two numbers were %d and %d \n", x, y); /* Read the 4th and the 5th number from the file data1. Notice that the old values of x and y are replaced by the new numbers we read from the file */ scanf("%d %d", &x, &y); printf("The last two numbers were %d and %d \n", x, y); return(0); } /* Output from this program: First number was 1 The next two numbers were 2 and 3 The last two numbers were 4 and 5 */