GATE CS 2025, set 2 · Question 19 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the following C program:
#include <stdio.h> void stringcopy(char *, char *); int main() char a[30] = "@#Hello World!"; stringcopy(a, a + 2); printf("%s ", a); return 0; void stringcopy(char *s, char *t) while(*t) *s++ = *t++;
Which ONE of the following will be the output of the program?

  1. (A) @#Hello World!
  2. (B) Hello World!
  3. (C) ello World!
  4. (D) Hello World!d!
Answer

Answer (D)

Answer from the official GATE CS 2025 answer key.

The step-by-step solution, where available, is part of GATE CS Pro. See what Pro includes