-
What will be the output of the following C code?
#include <stdio.h>
void main()
{
char *str = "InterviewMania";
char *ntr = "Mania";
char *ptr = str + ntr;
printf("%c\t%c", *ptr, str[1]);
}
-
- InterviewMania
- Mania
- Compilation Error
- I M
- None of these
Correct Option: C
Compilation Error
main.c: In function ‘main’:
main.c:6:25: error: invalid operands to binary + (have ‘char *’ and ‘char *’)
char *ptr = str + ntr;