Question discussion

What is the output of the following C program?#include int main() { char *s = "EduQuest"; printf("%c %c %s", *(s + 3), s[5], s + 4); return…

1161Medium DSSSB TGT Computer Science 0 replies 1 views
0

What is the output of the following C program?

#include <stdio.h>
int main() {
    char *s = "EduQuest";
    printf("%c %c %s", *(s + 3), s[5], s + 4);
    return 0;
}
  • AQ e Quest
  • Bu e uest
  • CQ s est
  • DQ e uest
Correct answer: D

Explanation

s[3] is 'Q', s[5] is 'e' and s + 4 points to "uest".

Discussion 0

Nobody has replied yet. Start the discussion!