#include <stdio.h> #include <string.h> int main() { char line[3]; fgets(line, 3, stdin); printf("%d\n", line[2]); return 0; }
a) Compilation error
b) Undefined behaviour
c) 0
d) 10(ascii value of newline character)
What will be the output of the following C code if 2 characters is typed by the user?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the output of the following C code if 2 characters is typed by the user?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!