Learn How to Program in C

by
Dr. Kristin Switala

Introduction

Directives

Variables

Conditionals

Loops

Arrays

Pointers

Strings

Functions

Structures


Site Map

Projects: Functions (a)

Instructions: Create a C program that runs successfully for each project below.


Project 1

Using a user-defined function, make a program that converts kilometers to miles.

The conversion calculation is: kilometers * 0.621 = miles


Project 2

Make a program that uses three user-defined functions:

  1. first function: calculate the viewer's age at the millenium (2000)
  2. second function: calculate the year of the viewer's 21st birthday
  3. third function: calculate the year of the viewer's 50th birthday

Print these three results.

Copyright
© 2001
Kristin Switala
Hosted by www.Geocities.ws

1