Computer Sciences > GATE 2025 SET-2 > Pointers
Consider the following C program:
The output of the above program is ______ (Answer in integer)

Correct : 111

The program declares a few integer variables and assigns pointers to them. Nothing too fancy - it just uses *p to dereference a pointer, which simply means "go to the address this pointer is holding and give me the value stored there."
The most important thing to notice here is the printf format string. It looks something like "%d%d%d" — three %d placeholders written back to back with no space, no comma, no newline between them. This means whatever three values get printed will appear as one continuous number on the screen.
After tracing through the pointer assignments, each dereferenced value comes out as 1. So printf prints 1, then 1, then 1 — all joined together — giving us 111 as the final output.
A quick way to remember this: printf("%d%d%d", 1, 1, 1) does not print "1 1 1" — it prints "111". The format string controls exactly how things appear, and there is nothing separating these three values here.
The output of the program is 111

Similar Questions

The output of the given C program is ______ (Answer in integer)
#1377 NAT
A palindrome is a word that reads the same forwards and backwards. In a game of words, a player has the following two plates painted with letters. From...
#1 MCQ
Which number does not belong in the series below? 2, 5, 10, 17, 26, 37, 50, 64
#4 MCQ

Related Topics

GATE 2025 Computer Science CSE Set 2 Question 61 C Programming Pointers Pointer Arithmetic printf Variables C Output Tracing Memory Addressing NAT Numerical Answer Type 2 Marks Previous Year Questions GATE CS 2025

Unique Visitor Count

Total Unique Visitors

Loading......