?
What will be the output of the following C code if 2 characters is typed by the user?
What will be the output of the following C code if 2 characters is typed by the user?
#include <stdio.h>
#include <string.h>
int main()
{
char line[3];
fgets(line, 3, stdin);
printf("%d\n", line[2]);
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char line[3];
fgets(line, 3, stdin);
printf("%d\n", line[2]);
return 0;
}
Join the Discussion
Login to post a comment or share your explanation.
Login