The first Assignment for I601
The Calculator Assignment

The second Assignment for I601
The Sesame Street Simulator

The third Assignment for I601
The Array Assignment

The in-class example from week 7. You need it for the next assignment.
Example -- strings and pointers

The fourth Assignment for I601
find and replace

The in-class example from week 8. You need it for the next assignment.
Example -- read write strings

the data file for the above

week 1
3Main function, printf(),scanf(), assignment, creating variables -- see below

Functions, If, Else, code blocks
Week 2 Examples

Here we introduce the FOR loop, a powerful command with great versilitity
Week 3 Examples

Introduces DO, WHILE, SWITCH.
Uses type char and getchar()
Shows the ASCII representation of letters

Week 5: Introduces character strings
Uses type coersion, shows float to int
Examples of functions

Introduces arrays
Uses special functions to handle arrays of char.Cindex6.html

Introduces pointers
Working with strings of char with ahd without pointers
Uses special functions to handle arrays of char.Cindex7.html

Introduces Files
Reading and Writing files
type FILE


This program adds two numbers. The numbers are built in,
you need to change the program to change the numbers.


This modification lets the user enter the numbers to be added,
a more realistic choice.
The scanf function is used to get input from the keyboard.


In this version of the program I have change things just a bit.

I have changed the data type to float.
This means that you can add numbers with decimal points.

The printf has been changed so that the addition
and the printing are done at the same time
This is the way a C programmer would do it
In fact, a programmer probably wouldn't have a variable for the sum.
The printf would look like:
printf("The sum is d%",num1 + num2);
Notice that I had to change the %d in printf to %f
to match the changed types of num1 and num2


This program is even more C programmer like.
It breaks the program into functions (main and summit)
The printf now displays all three numbers.

[ Home ]

This page is at: