engineering recuitment NIC NIELIT Scientist B 2023 Mock Test Programming and Data Structure Programming in C Pointer
Consider the C program given below
#include
struct charNode
{
char a, b, c, d;
};
int main()
{
struct charNode ch = {'o'+3,'e'+10,'j'+15,'t'+1};
struct charNode *ptr = &ch;
printf("%c, %c",*(char *)ptr + 1,*((char *)ptr + 2));
}
What is the output?
1
'o'+ 4, 'j'+15
2
's', 'y'
3
s, y
4
'o+ 4', 'j+15'