ASU CSE 240 MIDTERM
UPDATED ACTUAL QUESTIONS WITH CORRECT
ANSWERS
Question 1.
char, unsigned char, signed char and int are all numeric (integer) types in C (T/F)
ANSWER
True
Question 2.
(T/F) A program in C must contain at least one main
ANSWER
True
Question 3.
A name given to a storage location
ANSWER
Variable
Question 4.
(T/F) in C++, implementations of member functions cannot be inside the class definition (for short
functions) or outside of the class definition
ANSWER
False
1/7
, Question 5.
What is the equivalent C++ code to this code in JAVA:
int x = 5;
char a = 'A';
System.out.print("hello" + x + "," + a);
ANSWER
int x = 5;
char a = 'A';
cout<<"hello"<<x<<","<<a;
Question 6.
primitive data types can be modified using one or more of these modifers
ANSWER
signed, unsigned, short, long
Question 7.
control symbol %f is used for
ANSWER
printing formation for floating point values
Question 8.
Intermediate code
ANSWER
makes the language and the compiler machine-independent
Question 9.
(T/F) The scope resolution operator (::) is used to overload a function or an operator in OO paradigm
ANSWER
False
2/7
UPDATED ACTUAL QUESTIONS WITH CORRECT
ANSWERS
Question 1.
char, unsigned char, signed char and int are all numeric (integer) types in C (T/F)
ANSWER
True
Question 2.
(T/F) A program in C must contain at least one main
ANSWER
True
Question 3.
A name given to a storage location
ANSWER
Variable
Question 4.
(T/F) in C++, implementations of member functions cannot be inside the class definition (for short
functions) or outside of the class definition
ANSWER
False
1/7
, Question 5.
What is the equivalent C++ code to this code in JAVA:
int x = 5;
char a = 'A';
System.out.print("hello" + x + "," + a);
ANSWER
int x = 5;
char a = 'A';
cout<<"hello"<<x<<","<<a;
Question 6.
primitive data types can be modified using one or more of these modifers
ANSWER
signed, unsigned, short, long
Question 7.
control symbol %f is used for
ANSWER
printing formation for floating point values
Question 8.
Intermediate code
ANSWER
makes the language and the compiler machine-independent
Question 9.
(T/F) The scope resolution operator (::) is used to overload a function or an operator in OO paradigm
ANSWER
False
2/7