Programmnig Exercise

Practice the materials from the topic by implementing the projects presented below.

Multi Add

Write a program multi-add.c that takes one or more numbers as input arguments, then calculates the total sum and prints the answer to standard output. Compile the program and run it. Compile. Try debugging using a debugger.

Reverse Test

Write a program reverse-test.c that reads a string from the keyboard and prints it in reverse. To reverse the input string, you need to use the reverse library, which is provided in the directory /day02/reverse/. The function you need to use is:

void inplace_reverse(char * str)

You have all the resources to compile and link the library statically or you can use the shared library reverse from /usr/lib/libreverse.so. It is best to try both approaches.

Last updated

Was this helpful?