status = scanf("%d%d", &x, &y);
-
scanf reads from standard input
-
(1) reads data from the standard input, skipping leading whitespace;
(2) converts the input to the appropriate type according to given format specification, and
(3) stores the result into corresponding address location. -
%d in the format string means read characters from input and convert to an integer and store at the location specified by the next argument.
-
&x evaluates to the address of the int variable x; so the converted input value will be stored in x.
-
this scanf will read two character strings of digits, convert them to two binary integers and store these integers in variables x and y
-
the return value of scanf is the number of successful input conversions;
in this example the variable status will be assigned 2 if both inputs are valid integers.