ECS 30 Study Guide - Midterm Guide: Print Job, Chmod, Gnu Compiler Collection

79 views3 pages

Document Summary

Now you want to make sure that only you can read and write it. What unix command should you type? mv hw1/*. c hw1/*. h mid1 (5 points) you want to view the file test3. c a screen at a time. What unix command would you type? more test3. c: (50 points) write a complete, warning-free, c program that lists all of the common factors of two positive integers. The program will prompt the user for the two numbers, and then list on one line all the factors that the numbers have in common. A factor of a number divides into that number with a remainder of zero. The program will continue to ask the user for more pairs of numbers until the first number entered is zero. Your prompts and formats should match that shown. 7 for(i = 1; i <= num; i++) 12 if(num % i == 0 && num1 % i == 0)