- numeric I/O
- loops
- manipulating arrays
- numeric input until a condition occurs
- numeric input until end-of-input
- nested loops

`lab08`

by typing:
Change to this directory by typing:mkdir lab08

cd lab08

These revision exercises are not assessable.

They do not get marked.

There is no need to submit them with give.

Revision lab times will be announced which you can attend to get help with these revision exercises.

You may assume that the program's input will contain only integers and will contain at least 10 integers, in other words you can assume scanf succeeeds.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../read_ten1 2 4 16 32 64 128 256 512 1024Numbers were: 1 2 4 16 32 64 128 256 512 1024

~cs1511/bin/autotest lab08 read_ten.c

**Hint**: use **read_ten.c** as a starting point.

You may assume that the program's input will contain only integers and will contain at least 10 integers, in other words you can assume scanf succeeeds.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../reverse_ten1 2 4 16 32 64 128 256 512 1024Numbers were: 1024 512 256 128 64 32 16 4 2 1

~cs1511/bin/autotest lab08 reverse_ten.c

**Hint**: use **read_ten.c** as a starting point.

You may assume that the program's input will contain only positive integers and will contain at least 10 integers, in other words you can assume scanf succeeeds.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../odd_even_ten1 2 4 16 32 64 128 256 512 1024Odd numbers were: 1 Even numbers were: 2 4 16 32 64 128 256 512 1024./odd_even_ten3 5 7 11 13 11 9 7 5 3Odd numbers were: 3 5 7 11 13 11 9 7 5 3 Even numbers were:

~cs1511/bin/autotest lab08 odd_even_ten.c

**Hint**: use **odd_even_ten.c** as a starting point.

You may assume that the program's input will contain only integers, in other words you can assume scanf succeeeds.

You can assume a negative integer will always be read.

You can assume at most 1000 integers are read before a negative integer is read.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../odd_even_negative1 2 3 2 -42Odd numbers were: 1 3 Even numbers were: 2 2./odd_even_negative1 2 4 16 32 64 128 256 512 1024 2048 4096 -8192Odd numbers were: 1 Even numbers were: 2 4 16 32 64 128 256 512 1024 2048 4096

~cs1511/bin/autotest lab08 odd_even_negative.c

It should then print the odd numbers on one line then print the even numbers on one line.

**Hint**: use **odd_even_negative.c** as a starting point.

You may assume that the program's input will contain only integers.

You can assume at most 1000 integers will be read before end-of-input is reached.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../odd_even_eof1 2 4 16 32 64 128 256 512 1024 2048 4096Odd numbers were: 1 Even numbers were: 2 4 16 32 64 128 256 512 1024 2048 4096./odd_even_eof3 -3 4 -4 4Odd numbers were: 3 -3 Even numbers were: 4 -4 4

~cs1511/bin/autotest lab08 odd_even_eof.c

**Hint**: use **odd_even_eof.c** as a starting point.

You may assume that the program's command line arguments will only be integers.

You can assume at most 1000 command line arguments will be supplied.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../odd_even_argument 1 2 4 16 32 64 128 256 512 1024 2048 4096Odd numbers were: 1 Even numbers were: 2 4 16 32 64 128 256 512 1024 2048 4096./odd_even_argument 3 -3 4 -4 4Odd numbers were: 3 -3 Even numbers were: 4 -4 4

~cs1511/bin/autotest lab08 odd_even_argument.c

It should then print the integers read which are not exactly divisible by any other of the integers read.

In other words it should not print an integer if another integer that has been read is a factor of that number.

**Hint**: use **odd_even_eof.c** as a starting point.

You may assume that the program's input will contain only integers.

You may assume that all integers are > 1.

You can assume at most 1000 integers will be read before end-of-input is reached.

Match the the example below EXACTLY.

As usual autotest is available to help you test your program../indivisible42 7 6 12Indivisible numbers: 7 6./indivisible2 3 4 5 6 7 8 9 10Indivisible numbers: 2 3 5 7./indivisible5 6 5Indivisible numbers: 6

~cs1511/bin/autotest lab08 indivisible.c

They do not get marked.

There is no need to submit them with give.