Module 3 Flashcards

1
Q

include<conio.h></conio.h>

A

Preprocessor directive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Two slash signs inserted by the programmer in his C++ program indicate that the rest of the line is a _________.

A

comment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

include <_________> is the correct way of writing the preprocessor directive to include the contents of iostream in a C++ program

A

iostream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

C++ was developed by Bjarne Stroustrup as an enhancement to what programming language?

A

C language

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

cout«”Enter two numbers:”;

A

statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The library that defines various mathematical functions in C++.

A

math

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The symbol used in a preprocessor directive.

A

Sharp sign(#)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which directive instructs the compiler to add the contents of an include file into your program during compilation?

A

include

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

American computer scientist known for his invention of the C programming language

A

Dennis Ritchie

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

These are used to override the order of precedence and force some parts of an expression to be evaluated before other parts.

A

( ) paranthesis

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False: (a!=4) || !(b>c) where a=1, b=2, c=0

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

All are relational operators, except ______

A

< >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What value is placed in sum?

double sum = 10.0, price=100;
sum += price>=100 ? price*1.1 : price;

A

120

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which of the following can be considered as a valid identifier?

  • $Area
  • 123Height
  • First Name
  • Final_Grade
A

Final_Grade

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

________ characters are not allowed.

A

Special

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Given the declaration int num=5; Which of the following is the other way to initialize variables?

A

int num(5);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

These are the fixed values that do not change during the program’s execution.

A

Constants

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What value is placed in choice?

int a=5, b=10, c=15 ;
choice = a>b && a>c ? a : (b > c ? b : c) ;

A

15

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

The following symbols are referred to as relational operators except ______.

A

|

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

These are parts of the source code disregarded by the compiler. Their purpose is only to allow the programmer to insert notes or descriptions embedded within the source code.

A

Comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

The standard value that the return statement should return to signify successful execution of the program.

A

0

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

The _______ keyword tells the program to return a value to the function int main()

A

return

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

The ordinary arithmetic operations such as addition, subtraction, multiplication, division and modulus division needs the #include<math.h> pre-processor directive</math.h>

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

He was the developer of C++ programming language.

A

Bjarne Stroustrup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
All lines beginning with two slash signs (//) do have any effect on the behavior of the program.
False
26
An identifier must not be one of the keywords. Which of the following is NOT considered as an identifier?
Switch
27
C++ performs mathematical expression based on the order of precedence. Given the expression 3 + (9 – 7) * 5 / 2, which operator will be performed last?
+
28
C++ performs mathematical expression based on the order of precedence. Given the expression 3 + (9 – 7) * 5 / 2, which operator will be performed first?
-
29
Let a = 10. What will be the value of a after the following expression a -= 5; is executed?
5
30
Which of the following is not an example of an assignment statement?
a == b
31
The backslash constant that represents a new line.
\n
32
The special character that indicates a string constant in a Turbo C++ program.
" "
33
True or False: (a==9) && !(b>c) where a=9 b=8 c=7
False
34
The relational operator that can be used to test for equality of two expressions.
==
35
These are used to override the order of precedence and force some parts of an expression to be evaluated before other parts.
( ) paranthesis
36
Which of the following is not true about C++?
It is interpreted.
37
The following statements are true about C++ except __________.
It is a low-level language.
38
__________ is a programming language characteristic in which variable types are explicitly declared.
Statically typed
39
C++ is regarded as a ______-level language because it has a combination of both high-level and low-level language features.
middle
40
Which of the following user-defined identifiers is invalid in C++? - FIRSTNAME - Firstname - first_name - first-name
first-name
41
True or False: !(c>a) where c=2, a =4
True
42
The following symbols are relational operators except ______.
&&
43
Which of the following is NOT a primitive data type in C++ programming?
String
44
___________ contains all the classes, objects and functions of the standard C++ library.
namespace std
45
C++ is a free-form language is a programming language in which the positioning of characters on the page in program text is significant.
False
46
The following statements about int main() function is TRUE except ________.
Semicolon is required at the end of this statement.
47
These are names that are given to various elements of a program created by the program.
Identifiers
48
It is a named location in memory that is used to hold a value that may be modified by the program.
Variable
49
The operator used to divide two numbers and returns only the remainder.
%
50
Let a = 2, b = 5, c = 15 and d = 17. What will be the result of the following expression after it is evaluated? !((2<5) || (15 >7))
False
51
The symbols that indicate the beginning of main's function definition.
{
52
What value is placed in var? var = 12 > 9 ? 0 : 1; :
0
53
Consider the following program snippet. What will be the output? int A = 1, B = 2, C = 3, X = 4, Y = 5, Z = 6; A++; B--; --C; X = Y++ + --Z; cout << B++ - --C;
0
54
A sequence of letters, digits or underscore that may be used as a name of a variable, function, or class.
Identifiers
55
The standard output by default is the printer.
False
56
What is the output of the given program below? #include using namespace std; int main() { cout<
ABC
57
Given the declaration, int x, y; cin >>y>>x; When you run the program, you are asked to enter the values of x and y. You entered 3 and 5 successively, what are the values stored in x and y?
x = 5; y = 3
58
Given: const char SCHOOL[20] = "FIT"; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << "Number is" << num2;
Number is7
59
Given: const char SCHOOL[20] = "FIT"; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num2;
7
60
const char SCHOOL[20] = "FIT"; int num1, num2; Assume num1 contains 3 and num2 contains 7. Examine the output statement below and what it produces: cout << num1;
3
61
_______ is a function that inserts new line character and flushes the stream.
endl
62
If there is a chained multiple extraction operators (>>) in cin, the inputted values separated by space/s are _____ in the variables respectively.
stored
63
The function used to round the value toward zero and returns the nearest integral value.
trunc( )
64
We can perform implicit type conversion on: ____________
Converting char to int
65
Which of the following is not true in implicit type conversion?
It is a force type conversion.
66
The _______ functions maps a real number to the greatest preceding integer.
floor
67
Which of the following symbols is best used to make a 20-line statements as block comment?
/* */
68
#include, and #define are examples of preprocessor directives.
True
69
C++ is _____________ programming language.
case-sensitive
70
It is used to define symbolic names for constants.
#define
71
It is an operator used to alter the value of a variable
=
72
All variables in C++ must be declared ___ to their use.
prior
73
_______________________ are built-in that can be used directly by the user to declare variables.
Primitive data types
74
C++ programs are __________ not interpreted.
compiled
75
What value is placed in var? int x = 5, y = 19; var = y-x > x-y ? y-x : x-y ;
14
76
Which of the following is a valid identifier?
Gr_Level
77
The special character that terminates each statement in a C++ program.
semicolon (;)
78
Let a=2, b=5, c=15, d=17: Evaluate the given expression: cout << !((ad));
0 (FALSE)
79
All variables must be declared before it will be used. Which of the following is a correct declaration of variables?
float Wt, Ht;
80
Consider the following statements: int x = 22,y=15; x = (x>y) ? (x+y) : (x-y); What will be the value of x after executing these statements?
37
81
An operator that is also called ternary operator.
Conditional Operator