C Programming

Practise Exercise 4: for loops

JavaScript compatible inter-active version of this test.

1. Write a for loop to print out the values 1 to 10 on separate lines.

2. Write a for loop which will produce the following output (hint: use two nested for loops)

	1
	22
	333
	4444
	55555

3. Write a for loop which sums all values between 10 and 100 into a variable called total. Assume that total has NOT been initialized to zero.

4. Write a for loop to print out the character set from A-Z.

Answers


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