Home
Flashcards
Preview
CSC- Chapter 2 Quiz Questions
Home
Get App
Take Quiz
Create
The text of a comment can be...
anything the programmer wants to write.
A preprocessor directive starts with #. Preprocessor directives are carried out _______
just before a program is processed by the compiler.
Every C++ program must contain a _____ function.
main
Rearrange the following code so that it forms a correct program that prints out the letter Q:
int main()
}
// A SCRAMBLED program
return 0;
#include <iostream>
cout << "Q";
{
using namespace std;
1 //A SCRAMBLED program
2 #include <iostream>
3 using namespace std;
4 int main ()
5 {
6 cout << "Q";
7 return 0;
8 }
Write a statement that prints
Hello World
to the screen
1 cout <<"Hello World";
Suppose your name was Alan Turing. Write a statement that would print your last name, followed by a comma, followed by your first name.
1 cout << "Turning,Alan";
The word in the brackets of an include directive specifies
a file containing code that is copied into the program at that point.
Write the include directive needed to allow use of the various I/O operators such as cout and cin.
1 #include <iostream>
Write a statement that declares an int variable named
count
.
1 int count;
2 cout <<count;
Write a statement that declares an int variable named
count
.
1 int count;
2 cout <<count;
Declare an int variable named
degreesCelsius
.
1 int degreesCelcius;
Which of the following is NOT a legal identifier?
_
7thheaven
outrageouslyAndShockinglyLongRunon
lovePotionNumber9
_42
7thheaven (Can't start with a number)
Which of the following IS a legal identifier?
Five_&_Ten
LovePotion#9
_________
"Hello World"
5_And_10
____________
Which is the best identifier for a variable to represent the amount of money your boss pays you each month?
monthlyPay
Author
GoBroncos
ID
364153
Card Set
CSC- Chapter 2 Quiz Questions
Description
Updated
2/7/2024, 3:50:59 AM
Show Answers
Home
Flashcards
Preview