HW9
COP-3223H
Setup
See HW7's Setup for how to prepare for performing and submitting your homework.
Homework file names
- hw9-1.c
- hw9-2.c
Questions
(
hw9-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) { // 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); }- (
hw9-2.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.
Submission
See HW7's Submission instructions for adding, committing, and pushing your homework to the assignments' repo.
Self-check
See HW7's Self-check for instructions on checking what you have submitted to the remote grading repository.