C Programming

Practise Exercise 2: Assignments

Only use this if you have a forms compatible browser [Note: You must have an Internet connection in order to have these tests marked]

1. The statement which correctly assigns the value of the variable number1 to the variable total, is

2. The statement that correctly assigns the sum of the two variables loop_count and petrol_cost to the variable sum, is

3. The correct statement which divides the variable total by the value 10 and leaves the result in the variable discount, is

4. The correct statement which assigns the character W to the char variable letter, is

5. The correct statement which assign the decimal result of dividing the integer variable sum by 3 into the float variable costing, is ( Use type casting to ensure that floating point division is performed)

Given: int sum = 7; float costing;


To submit your comments, press this button:

To clear the form, press this button:


©Copyright B Brown. 1984-1998. All rights reserved.