Unit 4 C Programming Flashcards
What are the operands in this statement
int num = 5 + 7;
The operands are 5 and 7
What is the operator in this statement
int num = 5 + 7;
The operator is +
What is the order of operation in C
C follows BEDMAS
Brackets
Exponents
Divisions
Multiplications
Additions
Subtractions
What is the modulo operator?
The modulo operator is %
it means the remainder of
What happens if you do integer devision
The decimal portion is truncated after the division
What is a string in C
It’s an array of characters.
What is the last char in a char array
You set the last char as \0
this means NULL or Zero. It indicates the end of memory allocation
How do you declare a char array?
char name [5];
[‘R’], [‘Y’], [‘A’], [‘N’], [‘\0’]
What does the char array look when declared as
char name [5] = {‘\0’};
[‘\0’],[‘\0’],[‘\0’],[‘\0’],[‘\0’]
What happens when you declare a char array without putting the size but assigning a string
It will automatically assign the correct size