UP | HOME

HW6
COP-3223H

Submit this project via git (not webcourses) using the Uploading homework to git documentation.

  1. (hw6-1.c) Hand-copy yourself without copy-and-paste the following program into a file on eustis and compile and run it.

    #include <stdio.h>
    
    int main(int argc, char **argv) {
      int x;
      int y;
      float z;
    
      x = 355 / 113;
      y = 355.0 / 113.0;
      z = 355.0 / 113.0;
    
      printf("%d\n", x);
      printf("%d\n", y);
      printf("%f\n", z);
    }
    
  2. (hw6-2.c) Hand-copy yourself without copy-and-paste the following program into a file on eustis and compile and run it.

    #include <stdio.h>
    
    int main(int argc, char **argv) {
      // pi * r^2
      float pi;
      int r;
    
      pi = 355.0 / 113.0;
      printf("%f\n", pi);
    
      scanf("%d", &r);
      printf("%d\n", r);
    
      float result = pi * r * r;
    
      printf("%f\n", result);
    }
    
  3. (hw6-3.c) write a program that computes the following value. Input any 32-bit integer (using the template shown in class for reading input) and add it to the next-highest integer. Then add nine and divide the result by two. Subtract the original number. Do not precompute any valids and only use the variable usage and arithmetic operations shown in class so far. There should be at least five arithmetic operators being used.

Author: Paul Gazzillo

Created: 2026-07-26 Sun 20:06