Correct Answer - Option 3 : Abnormal termination of program
Scanf:
- In C, the scanf feature allows a programmer to accept input from a standard input device (keyboard) and store it in variables.
- The scanf function is very similar to the printf function.
- It reads data from the input device rather than printing it on the output device.
- Each variable must be preceded by the ampersand (&) address-of operator in scanf function.
Example:
1) int a;
scanf (" %d ", &a);
This will take the integer value and assign it to a, (No error).
2) int a;
scanf (" %d ", a);
It will gave "Segmentation fault"
It means accessing an invalid memory location, result in abnormal termination of the program.
Hence the option (3) is correct.