C++ Flashcards

1
Q

What is the difference between C and C++

A

The main difference is that C is a procedural programming language and does not support classes and objectd, while C++ is a combination of both procedural and object-orientated programming languages.

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

Is C a procedural language or an object orientated language?

A

Procedural

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

Is C++ a procedural language or an object orientated language?

A

object orientated

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

what are #include … lines called

A

pre-processor directives

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

include

A

contains functions for

converting data from one type to another

random number generators

memory managment

sorting

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

include

A

functions for performing input and output operations

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

include

A

resizeable arrays

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

include

A

allows you to manipulate strings

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

how to add a line below hello world when ouputted

std::cout

A

1)

std::cout

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

include

A

finding minimum and maximums

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

What is the difference between a Float and a Double

A

A float has 32 bit precision for a floating number.
A double has 64 bit precision for a floating number.

A double is more precise and requires more memory.

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

print hello world using printf()

A

printf(“hello world”)

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

printf(“%c”, ?)

A

A character e.g ‘A’

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

printf(“%d”,?)

A

interger e.g 10

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

printf(“%.3f”,?)

A

Three decimal place float

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

printf(“%s”,)

A

string e.g “hi”

17
Q

what does std::cin do

A

refers to input from keyboard

18
Q

what does std::stoi() do

A

convert string to interger

19
Q

how do you convert strings to doubles

A

std::stod

20
Q

What is the and operator in c++

A

&&

21
Q

What is the Or operstor in C++

A

||