0
What will be the output of the following code when the input is HelloWorld?
#include <stdio.h>
int main() {
char str[5]; // Buffer for input
int result = scanf("%4s", str);
if (result == 1) {
printf("Input: %s\n", str);
} else {
printf("Input error or no input.\n");
}
return 0;
}- AInput: Hell
- BInput: Hello
- CInput error or no input
- DInput: HelloWorld
Correct answer: A