You must time the test yourself and ensure you comply with the conditions below.
Write a C program middle3.c
that reads 3 integers and prints the middle integer.
You are not permitted to use loops or arrays (use if statements).
Your program should behave exactly like this example:
./middle3 Enter integer: 23 Enter integer: 5 Enter integer: 27 Middle: 23 ./middle3 Enter integer: 3 Enter integer: 6 Enter integer: 27 Middle: 6 ./middle3 Enter integer: 9 Enter integer: 7 Enter integer: 8 Middle: 8You can assume the user supplies 3 integers. You do not have to check the return value from scanf.
When you think your program is working you can autotest
to run some simple automated tests:
1511 autotest middle3When you are finished working on this exercise you must submit your work by running give:
give cs1511 test04_middle3 middle3.c
l.c
that reads an integer n from standard input.
and prints a pattern of asterisks in the shape of an "L".
You can assume n is positive.
Make your program match the examples below exactly.
You are not permitted to use arrays in this exercise.
./l Enter size: 2 * ** ./l Enter size: 5 * * * * ***** ./l Enter size: 9 * * * * * * * * *********
When you think your program is working you can autotest
to run some simple automated tests:
1511 autotest lWhen you are finished working on this exercise you must submit your work by running give:
give cs1511 test04_l l.c
hollow_triangle.c
that reads an integer n from standard input.
and prints a pattern of asterisks forming a hollow triangle.
You can assume n is greater than 3.
Make your program match the examples below exactly.
You are not permitted to use an array in this exercise.
dcc hollow_triangle.c -o hollow_triangle ./hollow_triangle Enter size: 4 * ** * * **** ./hollow_triangle Enter size: 5 * ** * * * * ***** ./hollow_triangle Enter size: 8 * ** * * * * * * * * * * ******** ./hollow_triangle Enter size: 11 * ** * * * * * * * * * * * * * * * * ***********
When you think your program is working you can autotest
to run some simple automated tests:
1511 autotest hollow_triangleWhen you are finished working on this exercise you must submit your work by running give:
give cs1511 test04_hollow_triangle hollow_triangle.c
You can run give multiple times. Only your last submission will be marked.
Don't submit any exercises you haven't attempted.
If you are working at home, you may find it more convenient to upload your work via give's web interface.
Remember you have until Friday 30 March 23:59:59 to complete this test.
Automarking will be run several days after the submission deadline for the test. When complete you can view automarking here and you can view the the resulting mark via give's web interface