GATE : Computer Science and IT

Consider the following C program segment.

What will be printed by the program?

,

Consider the following C program segment.

What will be printed by the program?

Consider the following C program segment.

What will be printed by the program?





Solution
C. 1204



Explanation

 Char s1 [7] = "1234", *p;
p = s1 + 2; // p holds address of character 3
*p = ‘0’; // memory at s1 + 3 now becomes 0
Print ("%s", s1); // All characters are printed
So the output is option C 1204
C is an imperative (procedural) language. It was designed to be compiled using a relatively straightforward compiler, to provide low-level access to memory, to provide language constructs that map efficiently to machine instructions, and to require minimal run-time support. C was therefore useful for many applications that had formerly been coded in assembly language, as in system programming.
Despite its low-level capabilities, the language was designed to encourage cross-platform programming. A standards-compliant and portably written C program can be compiled for a very wide variety of computer platforms and operating systems with few changes to its source code. The language has become available on a very wide range of platforms, from embedded microcontrollers to supercomputers.

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Exam Quiz Website development Company in Allahabad