Computer Science :: All Aptitude Test ::

1.In FORTRAN, the declarations of variables can be modified using which parameter ?
A. kind
B. make
C. select
D. kind

2.C99 standard guarantees uniqueness of characters for internal names ?
A. 31
B. 63
C. 12
D. 31

3.C99 standard guarantees uniqueness of characters for external names ?
A. 31
B. 6
C. 12
D. 31

4.Which of the following is not a valid variable name declaration ?
A. int __a3;
B. int __3a;
C. int __A3;
D. int __a3;

5.Which of the following is not a valid variable name declaration ?
A. int _a3;
B. int a_3;
C. int 3_a;
D. int _a3;

6.Why do variable names beginning with the underscore is not encouraged ?
A. It is not standardized
B. To avoid conflicts since assemblers and loaders use such names
C. To avoid conflicts since library routines use such names
D. It is not standardized

7.All keywords in C are in ?
A. LowerCase letters
B. UpperCase letters
C. CamelCase letters
D. LowerCase letters

8.Variable name resolution (number of significant characters for the uniqueness of variable) depends on ?
A. Compiler and linker implementations
B. Assemblers and loaders implementations
C. C language
D. Compiler and linker implementations

9.Which of the following is not a valid C variable name ?
A. int number;
B. float rate;
C. int variable_count;
D. int number;

10.Which of the following is true for variable names in C ?
A. They can contain alphanumeric characters as well as special characters
B. It is not an error to declare a variable to be one of the keywords(like goto, static)
C. Variable names cannot start with a digit
D. They can contain alphanumeric characters as well as special characters

11.Which is valid C expression ?
A. int my_num = 100,000;
B. int my_num = 100000;
C. int my num = 1000;
D. int my_num = 100,000;

12.What will be the output of the following C code ?
A. Hello World! x;
B. Hello World! followed by a junk value
C. Compile time error
D. Hello World! x;

13.What will be the output of the following C code ?
A. Compile time error
B. Hello World! 34
C. Hello World! 1000
D. Compile time error

14.Which of the following is not a valid variable name declaration ?
A. float PI = 3.14;
B. double PI = 3.14;
C. int PI = 3.14;
D. float PI = 3.14;

15.What will happen if the following C code is executed ?
A. It will cause a compile-time error
B. It will cause a run-time error
C. It will run without any error and prints 3
D. It will cause a compile-time error

16.What is the problem in following variable declaration ?
A. The variable name begins with an integer
B. The special character ‘-‘
C. The special character ‘?’
D. The variable name begins with an integer

17.What will be the output of the following C code ?
A. The program will print 12
B. The program will print 14
C. The program will have a runtime error
D. The program will print 12

18.Which of the following cannot be a variable name in C ?
A. volatile
B. true
C. friend
D. volatile

19.Which of the following is the correct syntax of including a user defined header files in C++ ?
A. #include
B. #include
C. #include “userdefined”
D. #include

20.Which of the following is a correct identifier in C++ ?
A. 7var_name
B. 7VARNAME
C. VAR_1234
D. 7var_name

21.Which of the following is called address operator ?
A. *
B. &
C. _
D. *

22.Which of the following is used for comments in C++ ?
A. // comment
B. /* comment */
C. both // comment or /* comment */
D. // comment

23.What are the actual parameters in C++ ?
A. Parameters with which functions are called
B. Parameters which are used in the definition of a function
C. Variables other than passed parameters in a function
D. Parameters with which functions are called

24.What are the formal parameters in C++ ?
A. Parameters with which functions are called
B. Parameters which are used in the definition of the function
C. Variables other than passed parameters in a function
D. Parameters with which functions are called

25.Which function is used to read a single character from the console in C++ ?
A. cin.get(ch)
B. getline(ch)
C. read(ch)
D. cin.get(ch)

26.Which function is used to write a single character to console in C++ ?
A. cout.put(ch)
B. cout.putline(ch)
C. write(ch)
D. cout.put(ch)

27.What are the escape sequences ?
A. Set of characters that convey special meaning in a program
B. Set of characters that whose use are avoided in C++ programs
C. Set of characters that are used in the name of the main function of the program
D. Set of characters that convey special meaning in a program

28.Which of the following escape sequence represents carriage return ?
A. \r
B. \n
C. \n\r
D. \r

29.Which of the following escape sequence represents tab ?
A. \t
B. \t\r
C. \b
D. \t

30.Who created C++ ?
A. Bjarne Stroustrup
B. Dennis Ritchie
C. Ken Thompson
D. Bjarne Stroustrup


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