C Programming :: All Aptitude Test ::

1.Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
A. rem = fmod(3.14, 2.1);
B. rem = 3.14 % 2.1;
C. rem = modf(3.14, 2.1);
D. rem = fmod(3.14, 2.1);

2.What are the types of linkages?
A. Internal
B. External and None
C. External, Internal and None
D. Internal

3.Which of the following special symbol allowed in a variable name?
A. - (hyphen)
B. _ (underscore)
C. | (pipeline)
D. - (hyphen)

4.Is there any difference between following declarations?
A. No difference, except extern int fun(); is probably in another file
B. int fun(); is overrided with extern int fun();
C. Both are identical
D. No difference, except extern int fun(); is probably in another file

5.How would you round off a value from 1.66 to 2.0?
A. roundto(1.66)
B. roundup(1.66)
C. floor(1.66)
D. roundto(1.66)

6.By default a real number is treated as a?
A. far double
B. long double
C. double
D. far double

7.Which of the following is not user defined data type?
A. 1
B. 2
C. 3
D. 1

8.Is the following statement a declaration or definition?
A. Error
B. Function
C. Definition
D. Error

9.Identify which of the following are declarations?
A. 1
B. 2
C. 1 & 3
D. 1

10.In the following program where is the variable a getting defined and where it is getting declared?
A. extern int a is declaration, int a = 20 is the definition
B. int a = 20 is declaration, extern int a is the definition
C. int a = 20 is definition, a is not defined
D. extern int a is declaration, int a = 20 is the definition

11.When we mention the prototype of a function?
A. Calling
B. Prototyping
C. Declaring
D. Calling

12.What is the output of the program given below ?
A. 1, 3, 2
B. 0, 2, 1
C. 1, 2, 3
D. 1, 3, 2

13.What will be the output of the program in 16 bit platform (Turbo C under DOS)?
A. 2
B. 4
C. vary from compiler
D. 2

14.What is the output of the program?
A. 20
B. 200
C. Garbage Value
D. 20

15.What is the output of the program in Turbo C (in DOS 16-bit OS)?
A. 2, 4, 6
B. 4, 4, 2
C. 2, 4, 4
D. 2, 4, 6

16.What is the output of the program?
A. 0, 0.000000
B. Error
C. Garbage values
D. 0, 0.000000

17.What will be the output of the program?
A. 10
B. 20
C. Error
D. 10

18.What is the output of the program?
A. 0
B. 1
C. Error
D. 0

19.What is the output of the program?
A. 3
B. 3.14
C. 4.33
D. 3

20.What is the output of the program?
A. 2, 3, 3
B. 3, 2, 2
C. 0, 0, 0
D. 2, 3, 3

21.What is the output of the program?
A. 3, 2, 5
B. 3, 2, 515
C. 515, 2, 3
D. 3, 2, 5

22.In the following program how long will the for loop get executed?
A. The for loop would not get executed at all
B. The for loop would get executed only once
C. The for loop would get executed 5 times
D. The for loop would not get executed at all

23.What will be the output of the program?
A. 40 40
B. 20 40
C. 20
D. 40 40

24.Point out the error in the following program (if it is compiled with Turbo C compiler)?
A. display() doesn't get invoked
B. display() is called before it is defined
C. No error
D. display() doesn't get invoked

25.Point out the error in the following program?
A. Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.
B. Program terminates abnormally.
C. No error.
D. Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.

26.Point out the error in the following program?
A. Error: in printf
B. Error: in emp int xx;
C. No error
D. Error: in printf

27.Which of the following is correct about err used in the declaration given below?
A. It is a typedef for enum error.
B. It is a variable of type enum error.
C. The statement is erroneous.
D. It is a typedef for enum error.

28.Point out the error in the following program?
A. Error: in int(*p)() = fun;
B. Error: fun() prototype not defined
C. No error
D. Error: in int(*p)() = fun;

29.Which of the declaration is correct?
A. int length;
B. char int;
C. int long;
D. int length;

30.Which of the following operations are INCORRECT?
A. int i = 35; i = i%5;
B. short int j = 255; j = j;
C. long int k = 365L; k = k;
D. int i = 35; i = i%5;


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