After tackling the Hello World assignment, try writing some other simple programs. You can use your hello world code as a starting point.
- change Hello World program to read & print a float instead of an int
- prompt user for 2 numbers and print them
- print 1 integer & 1 floating point number (instead of 2 ints)
- read and print the product of 2 ints (or floats)
- print only the larger of the two numbers entered
- print whether the entered number is even or odd
- print the largest even number (if there is one) or neither (if both are odd.)
- print the numbers from 1 to n (you don't need to use scanf for this one!)
- print the even numbers from 1 to n
- print the first ten multiples of the entered number
- print all multiples of the entered number that are less than 50
- print an n by m grid of numbers (addition table)
- print an n by m grid of numbers (multiplication table)
If you come up with any other interesting problems that can be solved with basic C code, please email them to me so that I can add them to the list!