CSCI 255 Assignment 6

Due date

This assignment must be submitted as a single file named yourlastname.c for Assignment 6 of the CSCI 255 section on UNCA moodle by 11:00 PM on Sunday, 22 November.

Your program should be written in standard ANSI C.

The Task

A few weeks ago, my daughter brought home an arithmetic assignment that read "If you count by this number, you will say 300, but you will not say 75." She was supposed to list those numbers where, if you started counting by them, you'd reach 300, but skip 75. 50 is an example of such a number, because you could count: 50, 100, 150, 200, 250, 300. The answer to her problem would have been a list of the twelve numbers: 2, 4, 6, 10, 12, 20, 30, 50, 60, 100, 150, 300.

I want you to write a program to solve the problem. Your program will read its two numbers from standard input as C int values.

You may assume that your "user" enters two valid integers. Your program should allow the numbers to be entered in any order, but it should check that (1) the two arguments are distinct, (2) both of the arguments are valid positive integers, and (3) the smaller number divides into the larger one.

Your program must list the output numbers in a neatly formatted columns. Here's an example of the output your program should produce when the two input numbers are 5 and 30.

     2
     3
     6
    10
    15
    30