Programming :: All Aptitude Test ::

Hassan
1.Point out the error, if any in the program?
A. Error: No case statement specified
B. Error: No default specified
C. No Error
D. Error: No case statement specified

2.Point out the error, if any in the program.
A. Error: No default specified
B. No Error and prints "Case1"
C. Error: Invalid printf statement after switch statement
D. Error: No default specified

3.Point out the error, if any in the while loop?
A. There should be a condition in the while loop
B. There should be at least a semicolon in the while
C. The while loop should be replaced with for loop.
D. There should be a condition in the while loop

4.Which of the following errors would be reported by the compiler on compiling the program given below?
A. There is no break statement in each case.
B. Expression as in case 3 + 2 is not allowed.
C. Duplicate case case 5:
D. There is no break statement in each case.

5.Point out the error, if any in the program?
A. Error: No default value is specified
B. Error: Constant expression required at line case P:
C. Error: There is no break statement in each case.
D. Error: No default value is specified

6.Point out the error, if any in the program?
A. Error: in case 1*2+4 statement
B. Error: No default specified
C. Error: in switch statement
D. Error: in case 1*2+4 statement

7.Point out the error, if any in the while loop?
A. No Error: prints "It works"
B. Error: fun() cannot be accessed
C. Error: goto cannot takeover control to other function
D. No Error: prints "It works"

8.Point out the error, if any in the program?
A. 100
B. 300
C. Error: L value required for b
D. 100

9.What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile?
A. It compiles
B. Compiles with an warning
C. Compiles and print nothing
D. It compiles

10.In which stage the following code?
A. During editing
B. During linking
C. During linking
D. During editing

11.What will be the output of the program?
A. 12, 6, 12
B. 11, 5, 11
C. 11, 5, Garbage
D. 12, 6, 12

12.What will be the output of the program?
A. Result = -100.000000
B. Result = -25.000000
C. Result = 0.000000
D. Result = -100.000000

13.What will be the output of the program?
A. 25
B. 11
C. Error
D. 25

14.What will be the output of the program?
A. str1=PAKMCQSstr2=MCQS
B. str1=PAKstr2=MCQS
C. str1=PAKstr2=PAKMCQS
D. str1=PAKMCQSstr2=MCQS

15.What will be the output of the program?
A. 9, 4
B. 27, 4
C. 27, 6
D. 9, 4

16.What will be the output of the program?
A. int=4, int=4, int=4
B. int=3, int=3, int=3
C. int=2, int=2, int=2
D. int=4, int=4, int=4

17.What will be the output of the program?
A. a = 10, b = 12
B. a = 12, b = 10
C. Error: Undefined symbol 't'
D. a = 10, b = 12

18.What will be the output of the program?
A. 10
B. 20
C. 1020
D. 10

19.What will be the output of the program?
A. 9
B. 5
C. 8
D. 9

20.What will be the output of the program?
A. 3
B. 4
C. 0
D. 3

21.What will be the output of the program?
A. Error: in macro substitution
B. Error: invalid reference 'x' in macro
C. print 'multiply'
D. Error: in macro substitution

22.What will be the output of the program?
A. junk
B. MESS
C. Error
D. junk

23.What will be the output of the program?
A. 2, 3, 4,
B. 2, 2, 2,
C. 3, 3, 3,
D. 2, 3, 4,

24.What will be the output of the program?
A. 5
B. 9
C. 10
D. 5

25.Point out the error in the program?
A. 26250.00 7500.00
B. Nothing will print
C. Error: Multiple declaration of si
D. 26250.00 7500.00

26.Point out the error in the program?
A. The number is odd
B. Garbage values
C. Error: unexpected end of file because there is no matching #endif
D. The number is odd

27.Which of the following are correct preprocessor directives in C?
A. 1, 2
B. 4
C. 1, 2, 4
D. 1, 2

28.Which of the following are correctly formed #define statements in C?
A. #define CUBE (X) (X*X*X);
B. #define CUBE(x) (X*X*X)
C. #define CUBE(X)(X*X*X)
D. #define CUBE (X) (X*X*X);

29.What is (void*)0?
A. Representation of NULL pointer
B. Representation of void pointer
C. Error
D. Representation of NULL pointer

30.Can you combine the following two statements into one?
A. char p = *malloc(100);
B. char *p = (char) malloc(100);
C. char *p = (char*)malloc(100);
D. char p = *malloc(100);


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