Unit 4 C Programming Flashcards

1
Q

What are the operands in this statement
int num = 5 + 7;

A

The operands are 5 and 7

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

What is the operator in this statement
int num = 5 + 7;

A

The operator is +

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

What is the order of operation in C

A

C follows BEDMAS
Brackets
Exponents
Divisions
Multiplications
Additions
Subtractions

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

What is the modulo operator?

A

The modulo operator is %
it means the remainder of

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

What happens if you do integer devision

A

The decimal portion is truncated after the division

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

What is a string in C

A

It’s an array of characters.

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

What is the last char in a char array

A

You set the last char as \0
this means NULL or Zero. It indicates the end of memory allocation

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

How do you declare a char array?

A

char name [5];

[‘R’], [‘Y’], [‘A’], [‘N’], [‘\0’]

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

What does the char array look when declared as
char name [5] = {‘\0’};

A

[‘\0’],[‘\0’],[‘\0’],[‘\0’],[‘\0’]

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

What happens when you declare a char array without putting the size but assigning a string

A

It will automatically assign the correct size

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