pseudocode Flashcards

1
Q

What is the first step to take when starting to learn C++?

A

Focus on grasping the big picture and building a strong foundation.

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

What is the purpose of libraries in C++?

A

Libraries provide pre-built functions and tools for various functionalities.

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

What is the generic skeleton of a C++ program?

A

It consists of library inclusion and the main function.

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

What is the syntax to declare the main function in C++?

A

int main() { /* Your code here */ return 0; }

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

What library is included for input and output operations in C++?

A

include<iostream></iostream>

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

How do you display output in C++?

A

Using the std::cout function.

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

What is the correct syntax to print ‘Hey, Striver!’ to the console?

A

std::cout &laquo_space;‘Hey, Striver!’;

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

What happens if you write std::cout &laquo_space;‘Hey, Striver!’; twice?

A

It prints ‘Hey, Striver!Hey, Striver!’ on the same line.

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

How can you insert a line break in C++ output?

A

By using the newline character \n.

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

What does std::endl do in C++?

A

Inserts a newline character and flushes the output buffer.

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

Which method is typically faster for adding line breaks in C++?

A

Using \n is faster than using std::endl.

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

What does ‘using namespace std;’ do in a C++ program?

A

Allows use of all names from the std namespace without prefixing with std::.

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

What is a potential drawback of using ‘using namespace std;’?

A

It may lead to naming conflicts in larger projects.

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

How do you take user input in C++?

A

Using the cin stream.

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

What is the syntax to read an integer input into a variable x?

A

cin&raquo_space; x;

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

What is the output when the input is 10?

A

Value of x: 10

17
Q

How can you accept multiple inputs in C++?

A

Using the&raquo_space; operator with cin for each variable.

18
Q

What is the shortcut to include almost all standard libraries in C++?

A

include<bits/stdc++.h>

19
Q

What is a potential downside of using #include<bits/stdc++.h>?

A

It may cause compatibility issues and impact compile time.

20
Q

Fill in the blank: The main function serves as the _______ for your program.

A

entry point

21
Q

True or False: std::endl flushes the output buffer after adding a newline.