10 points Estimated time: 5 minutesIn a file called hello.c, write a program which prints "Hello World" as output. Compile the program so that the resulting binary is called hello (using -o hello), and run it (./hello). [Yes, the code for this was given in lecture- this problem is just to get you started]
40 points (Step 0: 0 points, Step 1: 20 points, Step 2: 20 points) Estimated time: 15 minutesDownload the files: factmain.c and fact.h
fact.h provides the following prototype for factorial: int factorial (int x);As you may recall, factorial(0) should return 1, and factorial(x) should return x * factorial(x-1) for any other positive x. Your factorial function may exhibit any behavior on negative inputs. You may use either recursive or iteration.
/tmp/ccIFxXDl.o: In function `main': factmain.c:(.text+0x19): undefined reference to `factorial' collect2: ld returned 1 exit statusThis error results from the fact that there is no input procividing a definition of factorial. Now recall that compilation can be stopped at simply an object file (gcc -c factmain.c). This command should complete with no errors, and the object file factmain.o should now exist.
40 points (4 functions, 10 points each) Estimated time: 15 minutesThis problem will cover the aspects of arrays that look like Java arrays. For this problem you will be editing the file arrays.c. You must fill in the code for the following 4 functions:
array[0] = 10
array[1] = 15
array[2] = 7
10 points Estimated time: 5 minutesIn a text file called feedback.txt, briefly let me know what you thought of this homework. Was it too hard or too easy? Did you feel like it was useful in getting you acquainted with the basics of C?
CSE399: Homework1 SubmissionYou should submit a zip file containing all of the code, as well as the binary produced in step 1. Please name your zip file username.hwk1.zip (where username is whatever you login to eniac-l as). You can create the zip file with the following command:
zip adhilton.hwk1.zip *.c *.h hello feedback.txt(replace adhilton with your username) Then attach that zip file to an email. You can even send the email straight from enaic-l with the following command:
mutt -a adhilton.hwk1.zip -s"CSE399: Homework1 Submission" adhilton@cis.upenn.edu < /dev/null(yes, if that completes with no errors, it will just give back a prompt with no output)