Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add two numbers and store the result.
C
int a = 5, b = 3; int sum = a [1] b; printf("%d", sum);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' subtracts instead of adding.
Using '*' multiplies instead of adding.
✗ Incorrect
The + operator adds two numbers together.
2fill in blank
mediumComplete the code to find the remainder when dividing two numbers.
C
int x = 10, y = 3; int remainder = x [1] y; printf("%d", remainder);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '/' gives the quotient, not the remainder.
Using '*' multiplies instead of dividing.
✗ Incorrect
The % operator gives the remainder after division.
3fill in blank
hardFix the error in the code to multiply two numbers correctly.
C
int a = 4, b = 7; int product = a [1] b; printf("%d", product);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' adds instead of multiplying.
Using '/' divides instead of multiplying.
✗ Incorrect
The * operator multiplies two numbers.
4fill in blank
hardFill in the blank to calculate the quotient of two numbers as an integer division.
C
int a = 15, b = 4; int quotient = a [1] b; printf("%d", quotient);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '%' gives the remainder, not the quotient.
Using '*' multiplies instead of dividing.
✗ Incorrect
The / operator divides two integers and returns the integer quotient.
5fill in blank
hardFill both blanks to compute the expression: (a + b) * c.
C
int a = 2, b = 3, c = 4; int result = (a [1] b) [2] c; printf("%d", result);
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-' instead of '+' inside parentheses.
Using '/' instead of '*' for multiplication.
✗ Incorrect
First add a and b using +, then multiply the sum by c using *.