adplus-dvertising
frame-decoration

Question

What is the output of this program?
#include <stdio.h>
struct result{
  char sub[20];
  int marks;
};
void main()
{
      struct result res[] = { {"Maths",100},
      {"Science",90},
      {"English",85}
      };
    printf("%s ", res[1].sub);
    printf("%d", (*(res+2)).marks);
}

a.

Maths 100

b.

Science 85

c.

Science 90

d.

Science 100

Answer: (b).Science 85

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?