C Programming :: All Aptitude Test ::

1.Which of the following statement is correct about the program?
A. The code counts number of characters in the file
B. The code counts number of words in the file
C. The code counts number of blank lines in the file
D. The code counts number of characters in the file

2.Which of the statements is correct about the program?
A. The code writes a text to a file
B. The code writes a text to a file in reverse order
C. The code reads a text files and display its content in reverse order
D. The code writes a text to a file

3.Point out the correct statements about the program?
A. The code copies the content of one file to another
B. The code writes strings that are read from the keyboard into a file.
C. The code reads a file
D. The code copies the content of one file to another

4.In which numbering system can the binary number 1011011111000101 be easily converted to?
A. Decimal system
B. Hexadecimal system
C. Octal system
D. Decimal system

5.Which bitwise operator is suitable for turning off a particular bit in a number?
A. && operator
B. & operator
C. || operator
D. && operator

6.Which bitwise operator is suitable for turning on a particular bit in a number?
A. && operator
B. & operator
C. || operator
D. && operator

7.Which bitwise operator is suitable for checking whether a particular bit is on or off?
A. && operator
B. & operator
C. || operator
D. && operator

8.Assuming, integer is 2 byte, What will be the output of the program?
A. ffff
B. 0000
C. ffdf
D. ffff

9.If an unsigned int is 2 bytes wide then, What will be the output of the program ?
A. ffff
B. 0000
C. ffdf
D. ffff

10.Assuming a integer 2-bytes, What will be the output of the program?
A. ffff
B. fff8
C. 0
D. ffff

11.If an unsigned int is 2 bytes wide then, What will be the output of the program ?
A. ffff
B. 0000
C. 00ff
D. ffff

12.What will be the output of the program?
A. 0
B. 256
C. 100
D. 0

13.What will be the output of the program?
A. 4 1 8 1
B. 4 >> 1 8 >> 1
C. 2 4
D. 4 1 8 1

14.What will be the output of the program?
A. 12400
B. 12480
C. 12500
D. 12400

15.What will be the output of the program?
A. 1
B. 0
C. -1
D. 1

16.What will be the output of the program?
A. 0, 0, 0, 0, 0
B. 0, 32, 32, 32, 32
C. 32, 32, 32, 32, 0
D. 0, 0, 0, 0, 0

17.What will be the output of the program?
A. 32
B. 64
C. 0
D. 32

18.What will be the output of the program?
A. 4, 8, 0
B. 1, 2, 1
C. 12, 1, 12
D. 4, 8, 0

19.Which of the statements is correct about the program?
A. It prints all even bits from num
B. It prints all odd bits from num
C. It prints binary equivalent num
D. It prints all even bits from num

20.Which of the statements is correct about the program?
A. It counts the number of bits that are ON (1) in the number num.
B. It counts the number of bits that are OFF (0) in the number num.
C. It sets all bits in the number num to 1
D. It counts the number of bits that are ON (1) in the number num.

21.Which of the statements is correct about the program?
A. It converts a number to a given base.
B. It converts a number to its equivalent binary.
C. It converts a number to its equivalent hexadecimal.
D. It converts a number to a given base.

22.Which of the statements is correct about the program?
A. It will put OFF all bits that are ON in the number n
B. It will test whether the individual bits of n are ON or OFF
C. It will put ON all bits that are OFF in the number n
D. It will put OFF all bits that are ON in the number n

23.What will be the output of the program?
A. 128
B. Garbage value
C. Error
D. 128

24.What will be the output of the program ?
A. Error: RValue required
B. Error: LValue required in strcpy
C. Error: cannot convert from 'const int *' to 'int *const'
D. Error: RValue required

25.What will be the output of the program?
A. Address of i Address of j
B. 10 223
C. Garbage Value
D. Address of i Address of j

26.What will be the output of the program?
A. 5
B. 10
C. Garbage Value
D. 5

27.What will be the output of the program?
A. i= FFE2 ptr=12 j=FFE4 ptr=24
B. i= FFE4 ptr=10 j=FFE2 ptr=20
C. i= FFE0 ptr=20 j=FFE1 ptr=30
D. i= FFE2 ptr=12 j=FFE4 ptr=24

28.What will be the output of the program?
A. Error
B. H
C. Hello
D. Error

29.What will be the output of the program?
A. 20
B. 0
C. Garbage Value
D. 20

30.What will be the output of the program?
A. 10
B. 11
C. No output
D. 10


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