Question: show work please, thank you. ECE 175, Computer Programming for Engineering Applications 2 of 7 1. (8 points) Basics of C - The following program

show work please, thank you. ECE 175, Computer Programming for Engineering Applications2 of 7 1. (8 points) Basics of C - The followingprogram compiles and runs without errors. What is printed? #include int main(void){ float c = 3.2, d 5.0; int = 5, b =7; a * + = %d ", a, b); b = b/ a + d printf("a = %d\tb b = ++ ai ashow work please, thank you.

ECE 175, Computer Programming for Engineering Applications 2 of 7 1. (8 points) Basics of C - The following program compiles and runs without errors. What is printed? #include int main(void) { float c = 3.2, d 5.0; int = 5, b = 7; a * + = %d ", a, b); b = b / a + d printf("a = %d\tb b = ++ ai a = b ++; printf ("a = %d\tb %dln", a, b); return(0); } Write your answer here: y 2. (5 points) Basics of C - The following program compiles and runs without errors. Determine the value of b after execution of the following block of code. #include int main (void) { int X = 29, 4, Z = 8; x /= y; y = X - Y ; x = y / X; z = y; printf("%d\t%d\t%.2f ", x, y, y / 2.0); printf("%d\t% ", z, (char) 57); return(0); } Write your answer here: 3. (9 points) Branches and Loops - The following programs compile and run without errors. They are identical, except for lines 5 and 9. Line numbers have been included for your convenience. What will each program print? + 1 #include 2 int main(void) { 3 int i = 5, j = 8k = 5; 4 5 while (i 2 int main(void) { 3 int i = 5, j = 8 k = 5; 4 5 do { 6 k = k 2; 7 i = k / 2 - i; 8 j--; 9 } while (i int y) { int funfunc (int x, x = y / 2 + X; y = 3 * y + x; return (x); } int y) { int AnotherFunc(int x, int 2; z = funfunc(y, x); return (z); } int main(void) { int x = 1, y = 4, 2; z = funfunc (x, y); printf("% = %d, y = %d, z = %d ", x, y, z); z = funfunc (y +3, x); //**** Be Careful Here **** // printf("x = %d, y = %, z = %d ", x, y, z); z = AnotherFunc(25, 7); printf("x = $d, y = $d, return(0); //**** Be Careful Here ****// z = %d ", x, y, z); } Write your answer here: ECE 175, Computer Programming for Engineering Applications 6 of 7 7. (12 points) File I/O - Write a block of C code that copies the contents of file file.txt to file file_copy.txt Your code must Open the file file.txt for reading only. Check that the file file.tat opens successfully. If the file is not successfully open then print an error message and exit the program. Open the file file_copy.txt for writing. . Read all information from file.txt and write it to file_copy.txt with the following criteria: - Leave all lowercase letters unchanged. - Change uppercase letters to lowercase. - Leave all other characters unchanged. Make sure the files are closed before exiting the program. Write your answer here

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!