Strings - Find Output of Program :: Discussion


31.What will be the output of the following program in 16 bit platform assuming that 1022 is memory address of the string "Hello1" (in Turbo C under DOS) ?
A.1022 Hello2
B.Hello1 1022
C.Hello1 Hello2
D.1022 1022
Answer:  Option  A
Explanation:

In printf("%u %s\n", &"Hello", &"Hello");.

The %u format specifier tells the compiler to print the memory address of the "Hello1".

The %s format specifier tells the compiler to print the string "Hello2".

Hence the output of the program is "1022 Hello2".

Tutorial Link:
Published by:Michael Daani

Comments are not available

Post your comments here:

Optional

Date to Date Current Affairs 2022

PakMCQs.net

Quick Links

GAT Subject



   Computer Science    English Mcqs    Agriculture    

Engineering



   Computer Science    Civil Engineering    

Technical



   Networking    Electronics    Database    

Past Papers



   Model Papers    FPSC Papers