Data types
Functions
If Else Statements
For and While Loops
Printf statements
100
This data type is used to store a single variable.

What is char?

100

This function is used to output statements.

What is printf?

100

int x = 7;
if (x > 5)
    printf("A");
else
    printf("B");

What is printed?

What is A
100

for (int i = 0; i < 3; i++) { 

printf("Hi "); 

}

This is the amount of times "Hi " is printed.

3

100

int x = 4;
printf("%d", x + 3);

What does it print

What is 7

200

This is how many bytes a double occupies

What is 8

200

Fill in the blank to read one character: scanf("___", &ch);

What is %c?

200

int x = 10;
if (x % 2 == 0 && x > 15)
    printf("A");
else
    printf("B");

This is printed.

What is A?

200

for (int i = 1; i <= 5; i++)
{
    printf("%d ", i);
}

This is what's printed

What is 1 2 3 4 5 ?

200

char letter = 'G';
printf("%c", letter);

This is what it prints

What is G

300

This is how many bytes a char occupies

What is 1

300
This is how you read in a string using scanf

scanf("%s", str);

300

int x = 8;
if (x > 5)
{
    if (x < 10)
        printf("A");
    else
        printf("B");
}
else
{
    printf("C");
}

This is printed

What is A?

300

int x = 1;
while (x < 10)
{
    x = x * 2;
}
printf("%d", x);

This is what's printed

What is 16?

300

int x = 7;
int y = 2;
printf("%d", x / y);

This is what it prints

What is 3

400

This is how to read in an integer n using scanf

scanf("%d", &n);
400

This is the kind of variable type that does not require a % when reading in with scanf.

What is a string?

400

int x = 12;
if (x < 10)
{
    printf("A");
}
else if (x % 5 == 2)
{
    printf("B");
}
else
{
    printf("C");
}

This is printed.

What is B?

400

int total = 0;
for (int i = 1; i <= 4; i++)
{
    total = total + i;
}
printf("%d", total);

This is what's printed

What is 10?

400

int x = 10;

int y = 2;

int z = 4;

printf("%d", x % z / y);

What does it print

What is 1
500

Given char word[12], this is the maximum number of (readable) characters the string can store.

11

500

Explain why " %c" sometimes works better than "%c" when reading in a character right after an integer

What is because characters do weird stuff with whitespace and scanf might read in the space instead of the character

500

int x = 14;
int y = 5;
if (x > 10)
{
    if (x % y < 3)
    {
        y = y + 2;

        if (x / y == 2)
            printf("A");
        else
            printf("B");
    }
    else
    {
        printf("C");
    }
}
else
{
    printf("D");
}

What is C?

500

int x = 10;
while (x > 0)
{
    printf("%d ", x);
    x = x - 3;
}

This is what's printed

What is 10 7 4 1 ?

500

int total = 0;

for (int i = 1; i <= 5; i++)
{
    if (i % 2 == 0)
        total = total + i;
}

printf("%d", total);

This is what it prints

What is 6