« Grades Have Been Posted | Main | Office Hours Canceled »
Wednesday
Jan182012

Demo Code for Jan. 18

ex7.c.

#include <stdio.h>
#include "count.h"

void main()
{
    printf("starting now:\n");
        
    one_three();
    
    printf("joe cant spell!!!!!!!\n");
}

count.h

/* function prototypes */
void one_three();
void two(void);

count.c

#include <stdio.h>
#include "count.h"

void one_three()
{
    printf("one\n");
    
    two();
    
    printf("three\n");

}
void two()
{
    printf("two\n");
}

iodemo.h

#include <stdio.h>

int main()
{
    int value0 = 42, value1, value2;
    
    printf("val1 = %d", value1);
    printf("\nval1 lives at %d", &value1);
    getchar();
    printf("val2 = %d", value2);
    printf("\nval2 lives at %d", &value2);
    getchar();
    
    
    
    printf("Enter a number: ");
    scanf("%d", &value1);
    
    printf("Enter another number: ");
    scanf("%d", &value2);
    
    printf("The sum of %d and %d is %d", value1, value2, value1 + value2);
    
    

    return 0;
}