Homework 1

Due dates

This assignment is due by class on Thursday, 2 September, 2010. You will turn this assignment in by email to brock@cs.unca.edu from an offical university address.

Part 1

Compile and run the following program, based on last year's Assignment 1 on either your home computer or a lab computer at your college.

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char** argv) {
  int lower, upper, n ;

  printf("Lower integer: \n");
  scanf("%d", &lower);

  printf("Upper integer: \n");
  scanf("%d", &upper);

  printf("\n       n     (n-1)/n\n") ;
  for(n=lower; n<=upper; n++) {
    printf("%8d    %8.5f\n", n, (float)(n-1)/n) ;

  return (EXIT_SUCCESS);

Part 2

Send email to brock@cs.unca.edu from an official student email account with the following description:

  1. A statement that you have run the program
  2. A description of the software used to run the program
  3. A description of your programming experience