Computer Science :: All Aptitude Test ::

1.The format identifier ‘%i’ is also used for data type ?
A. char
B. int
C. float
D. char

2.Which data type is most suitable for storing a number 65000 in a 32-bit system ?
A. Signed short
B. Unsigned short
C. long
D. Signed short

3.Which of the following is a User-defined data type ?
A. typedef int Boolean;
B. typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
C. struct {char name[10], int age};
D. typedef int Boolean;

4.What is the size of an int data type ?
A. 4 Bytes
B. 8 Bytes
C. Depends on the system/compiler
D. 4 Bytes

5.What will be the output of the following C code ?
A. 128
B. -128
C. 256
D. 128

6.What will be the output of the following C code ?
A. a
B. Infinite loop
C. Depends on what fgetc returns
D. a

7.What is short int in C programming ?
A. The basic data type of C
B. Qualifier
C. Short is the qualifier and int is the basic data type
D. The basic data type of C

8.What will be the output of the following C code ?
A. equal
B. not equal
C. output depends on the compiler
D. equal

9.What will be the output of the following C code ?
A. equal
B. not equal
C. output depends on compiler
D. equal

10.What will be the output of the following C code on a 32-bit machine ?
A. p and q are 4 and 4
B. p and q are 4 and 8
C. compiler error
D. p and q are 4 and 4

11.What will be the output of the following C code on a 64 bit machine ?
A. 8
B. 5
C. 9
D. 8

12.What will be the output of the following C code?
A. a
B. run time error
C. a.0000000
D. a

13.Which of the data types has the size that is variable ?
A. int
B. struct
C. float
D. int

14.What will be the output of the following C code ?
A. PEACH = 3
B. PEACH = 4
C. PEACH = 5
D. PEACH = 3

15.What will be the output of the following C code ?
A. C programming Class by WOW PAK-MCQs
B. C programming Class by\n%s PAK-MCQs
C. C programming Class by %s PAK-MCQs
D. C programming Class by WOW PAK-MCQs

16.In the following code snippet, character pointer str holds a reference to the string ?
A. pak-mcqs.net
B. pak-mcqs.net\0training classes
C. pak-mcqs.nettraining classes
D. pak-mcqs.net

17.What will be the output of the following C code ?
A. a = 5
B. a = 10
C. Compilation error
D. a = 5

18.What will be the output of the following C code ?
A. 2
B. 8
C. 9
D. 2

19.What will be the output of the following C function ?
A. 2
B. 4
C. 8
D. 2

20.What will be the output of the following C code ?
A. 2
B. 4
C. 5
D. 2

21.What will be the output of the following C code ?
A. 2 2
B. 1 1
C. 2 1
D. 2 2

22.enum types are processed by ?
A. Compiler
B. Compiler
C. Linker
D. Compiler

23.What will be the output of the following C code ?
A. pak-mcqsclass
B. pak-mcqs-class
C. classcqs
D. pak-mcqsclass

24.What will be the output of the following C code ?
A. p is 4
B. Compile time error
C. Run time error
D. p is 4

25.Which of the following PHP statement/statements will store 111 in variable num ?
A. Both i) and ii)
B. i), ii), iii) and iv)
C. Only iii)
D. Both i) and ii)

26.What will be the output of the following PHP code ?
A. 3
B. 1+2
C. 1.+.2
D. 3

27.What will be the output of the following PHP code ?
A. 3
B. 1+2
C. Error
D. 3

28.Which is the right way of declaring a variable in PHP ?
A. Only ii)
B. Only iii)
C. ii), iii) and iv)
D. Only ii)

29.What will be the output of the following PHP code ?
A. Error
B. My name is BobBob
C. My name is BobMy name is Bob
D. Error

30.Which of the following PHP statements will output Hello World on the screen ?
A. i) and ii)
B. i), ii) and iii)
C. i), ii), iii) and iv)
D. i) and ii)


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