Programming :: All Aptitude Test ::

Hassan
1.In which header file is the NULL macro defined?
A. stdio.h
B. stddef.h
C. stdio.h and stddef.h
D. stdio.h

2.How many bytes are occupied by near, far and huge pointers (DOS)?
A. near=2 far=4 huge=4
B. near=4 far=8 huge=8
C. near=2 far=4 huge=8
D. near=2 far=4 huge=4

3.If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?
A. .
B. &
C. *
D. .

4.What would be the equivalent pointer expression for referring the array element a[i][j][k][l]
A. ((((a+i)+j)+k)+l)
B. *(*(*(*(a+i)+j)+k)+l)
C. (((a+i)+j)+k+l)
D. ((((a+i)+j)+k)+l)

5.A pointer is?
A. A keyword used to create variables
B. A variable that stores address of an instruction
C. A variable that stores address of other variable
D. A keyword used to create variables

6.The operator used to get value at address stored in a pointer variable is?
A. *
B. &
C. &&
D. *

7.What will be the output of the program ?
A. ink
B. ack
C. ite
D. ink

8.What will be the output of the program ?
A. 30
B. 27
C. 9
D. 30

9.What will be the output of the program ?
A. x=31, y=502, z=502
B. x=31, y=500, z=500
C. x=31, y=498, z=498
D. x=31, y=502, z=502

10.What will be the output of the program ?
A. Mello
B. Hello
C. HMello
D. Mello

11.What will be the output of the program If the integer is 4bytes long?
A. 8, 8, 8
B. 4000, 4002, 4004
C. 4000, 4004, 4008
D. 8, 8, 8

12.What will be the output of the program ?
A. Error: cannot convert from void** to int**
B. Garbage value
C. 0
D. Error: cannot convert from void** to int**

13.What will be the output of the program ?
A. Error
B. K
C. %S
D. Error

14.What will be the output of the program ?
A. 10
B. 20
C. Error: Non portable pointer conversion
D. 10

15.What will be the output of the program if the size of pointer is 4-bytes?
A. 2, 1
B. 2, 2
C. 4, 1
D. 2, 1

16.What will be the output of the program?
A. JCK
B. J65K
C. JAK
D. JCK

17.What will be the output of the program?
A. 8, 10
B. 10, 2
C. 8, 1
D. 8, 10

18.What will be the output of the program assuming that the array begins at the location 1002 and size of an integer is 4 bytes?
A. 448, 4, 4
B. 520, 2, 2
C. 1006, 2, 2
D. 448, 4, 4

19.What will be the output of the program?
A. 2, 3
B. 2, 0
C. 2, Garbage value
D. 2, 3

20.What will be the output of the program?
A. 3
B. 30
C. 300
D. 3

21.What will be the output of the program?
A. Error: in printf
B. Nothing will print
C. print "X" of PAKMCQS
D. Error: in printf

22.What will be the output of the program?
A. peace
B. eace
C. ace
D. peace

23.What will be the output of the program?
A. llo
B. hello
C. ello
D. llo

24.hat will be the output of the program assuming that the array begins at location 1002?
A. 1002, 2004, 4008, 2
B. 2004, 4008, 8016, 1
C. 1002, 1002, 1002, 1
D. 1002, 2004, 4008, 2

25.What will be the output of the program?
A. 5
B. 25
C. 125
D. 5

26.What will be the output of the program?
A. Alice
B. ecilA
C. Alice lice ice ce e
D. Alice

27.What will be the output of the program?
A. 7, 9, 11, 13, 15
B. 2, 15, 6, 8, 10
C. 2 4 6 8 10
D. 7, 9, 11, 13, 15

28.If the size of integer is 4bytes, What will be the output of the program?
A. 10, 2, 4
B. 20, 4, 4
C. 16, 2, 2
D. 10, 2, 4

29.Point out the compile time error in the program given below?
A. Error: invalid assignment for x
B. Error: suspicious pointer conversion
C. No error
D. Error: invalid assignment for x

30.Point out the error in the program?
A. Error: Declaration syntax
B. Error: Expression syntax
C. Error: LValue required
D. Error: Declaration syntax


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