1/115
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
Front: What is the basic structure of a C++ program in order?
Back: Documentation Section → Linking Section → Definition Section → Global Declaration Section → Member Function Definitions → Main Function.
Front: What is the Documentation Section used for?
Back: To document the program’s objective, developer, and logic using comments (/* … */).
Front: What does the Linking Section do?
Back: It tells the compiler to link keywords/functions to header files (e.g., #include
Front: What is iostream used for?
Back: It contains declarations for cin and cout, which handle input and output.
Front: What is cout?
Back: A predefined object representing the standard output stream; used with << to display data.
Front: What is cin?
Back: A predefined object representing the standard input stream; used with >> to read data.
Front: What is the Definition Section?
Back: It declares constants using #define (e.g., #define MAX 25).
Front: What is the Global Declaration Section?
Back: Where variables and class definitions used throughout the program are declared outside main().
Front: What is the Main Function Section?
Back: main() is where program execution starts; contains declaration and executable sections.
Front: What are the two parts of the main function?
Back: Declaration section (variables) and Executable section (instructions).
Front: What is a data type?
Back: It indicates the type of data stored in a variable (e.g., int, char, float).
Front: What are the three classes of data types in C++?
Back: Primitive, Derived, and User-defined.
Front: What are Primitive Data Types?
Back: Built-in types like int, char, float, bool, double, void.
Front: What is the size and range of an int typically?
Back: 4 bytes, range: -2,147,483,648 to 2,147,483,647.
Front: What is the size of a char?
Back: 1 byte, range: -128 to 127 or 0 to 255.
Front: What values can a bool hold?
Back: true (1) or false (0).
Front: What is the size of a float?
Back: 4 bytes.
Front: What is the size of a double?
Back: 8 bytes.
Front: What does void represent?
Back: A valueless entity; used for functions that do not return a value.
Front: What are Derived Data Types?
Back: Types derived from primitives: Function, Array, Pointer, Reference.
Front: What are User-defined Data Types?
Back: Types defined by the programmer: Class, Structure, Union, Enumeration, typedef.
Front: What is #include
Back: For input/output manipulation, e.g., setprecision().
Front: What does setprecision() do?
Back: Sets the number of decimal places to display in floating-point output.
Front: What are C++ tokens?
Back: The smallest individual units of a program: Keywords, Identifiers, Constants, Variables, Operators.
Front: What are Keywords?
Back: Reserved words with special meaning (e.g., int, class, if).
Front: What are Identifiers?
Back: Names given to variables, functions, classes, etc.
Front: What is an example of a constant?
Back: A fixed value like 5, 3.14, or 'A'.
Front: What is an operator?
Back: Symbols that perform operations (e.g., +, -, ==, <<).
Front: What is the purpose of using namespace std;?
Back: Allows use of names from the standard library without prefixing std::.
Front: In the example program that adds two numbers, what does cin >> x; do?
Back: Waits for user input and stores it in variable x.
Front: How do you print a Boolean variable’s value?
Back: cout prints 1 for true and 0 for false.
Front: What is the >> operator called with cin?
Back: Extraction operator.
Front: What is the << operator called with cout?
Back: Insertion operator.
Front: What is the difference between float and double?