C Programming

Practise Exercise 2: Assignments

JavaScript compatible inter-active version of this test.

1. Assign the value of the variable number1 to the variable total

2. Assign the sum of the two variables loop_count and petrol_cost to the variable sum

3. Divide the variable total by the value 10 and leave the result in the variable discount

4. Assign the character W to the char variable letter

5. Assign the result of dividing the integer variable sum by 3 into the float variable costing. Use type casting to ensure that the remainder is also held by the float variable.


ęCopyright B Brown. 1984-1999. All rights reserved.