GATE CS 2025 (Afternoon) — Question 19

Programming in CPointers, Multi-Dimensional Arrays, StructuresMCQ1 mark · −1/3 if wrongMedium

Consider the following C program:
c
1#include <stdio.h>
2void stringcopy(char *, char *);
3int main( ) {
4    char a[30] = "@#Hello World!";
5    stringcopy(a, a + 2);
6    printf("%s\n", a);
7    return 0;
8}
9void stringcopy(char *s, char *t) {
10    while(*t)
11        *s++ = *t++;
12}
13
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!
Practise the full 2025-AN paper
Challenge a friend: WhatsApp Telegram
From RENYXERAPractise this subject in the exam simulatorTimed, GATE-style tests with analytics that find your weak topics.
Practise more on Pointers, Multi-Dimensional Arrays, StructuresTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group