HW8
COP-3223H
Setup
See HW7's Setup for how to prepare for performing and submitting your homework.
Homework file names
Use the following names for the homework problems.
- hw8-1.c
- hw8-2.c
Questions
(
hw8-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); }(
hw8-2.c) Using only the C program template from class and without precomputing any intermediate values of the expression, write a program that computes 3^5 using one multiplication at a time, using only variable assignment, variable use, multiplication, and printf (there will be multiple printf statements.). Use a new, separate variable for each new multiplication that uses the previous variable, and printing the that variable after computing the result of each multiplication, i.e., the output should be9 27 81 243
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.