engineering recuitment UKPSC Polytechnic Lecturer Mock Test 2024 Programming and Data Structure Programming in C Pointer
What is the value printed of the following C program?
#include
struct node
{
char p, q, r;
};
int main()
{
struct node m = {'a'+5 ,'1','c'+1};
struct node *n = &m;
printf("%c, %c", *(char *)n ,*((char *)n + 2));
}1
'f', 'd'
2
f, d
3
'a'+5, 'c'+1
4
'a+ 5', ' c + 1'