your resources to programming and free tutition


C++ soon here!
VB - soon here!






Next Back


1.    Enter and run the 'Printing & Formatiiong Variable Types' program (found in lesson 3).

2.    If a human heart beats on average once a second how many time does the heart beat in a 78 year lifetime?
       Write a program to calculate your answer.

What data types would you use to hold the following data?

Customer initial
Customer name
Your house number
A price
Car registrations
The time
A six digit number

Write C statements to declare them all.

3.    Write a program that shows what happens if you exceed the maximum integer size by one.

4.    Write a program that computes the number of seconds in a year.

5.    Write a program that divides the value 47 by the value 12 and displays the result with an appropriate message.

6.    Enter and run the following program:

#include <stdio.h>

void main()

int x, y;
x = 0;
y = 27 / x;
printf("y = %d\n", y);


Do you get any error messages and if so why ?

7.    Write a program that demonstrates the use of the output formatters:

left justification in its field;
a number specyfing minimum field width;
significant fractional digits for a float;

8.    Write a program that calculates the umber of das you have lived. Decide how complex you want to make the
       program before you write it.

go to lesson 3

Q: Why did the blonde drive into the ditch?
A: To turn the blinker off.