ECS 30 Study Guide - Midterm Guide: Sqr, Gnu Compiler Collection, C String Handling

46 views2 pages

Document Summary

1. (10 points) given the following makefile, called makefile. 2. (20 points) char *strcat(char *s1, const char *s2) What does the function do as whole? (do not describe what each line does. ) void pb(int n) { It prints out the binary representation of n starting with the leftmost 1. #endif i = 10 * inc(j); i = sub(j, k); i = sqr(sqr(j++)); i = cube(j); #define sqr i = sqr(j); return 0; i = sqr(j); (68 points) write a program that counts how many times each of the 26 letters is used in the file test. txt and then prints out the result. Your program must contain two functions besides main: 1) count_letters reads from the file and counts the number of occurrences of each letter, and 2) show_results prints to the screen the results of the counting. There has been an alarming increase in the number of things i know nothing about.