Work 02: If you're feeling rusty, apply eul.

posted Sep 15, 2017, 7:13 AM by JonAlf Dyrland-Weaver   [ updated Sep 15, 2017, 7:53 AM ]
The time has come for you to write a c program.
  1. Look at the problems here: http://projecteuler.net/index.php?section=problems
  2. They are all math problems of some sort, pick two and write a c program to solve them.
    • Some good starters are problems 1, 5 and 6
    • Finished early? pick a third, a fourth, a fifth...
  3. Remember, c syntax is the same as java, so all your old friends (if, while, else, for...) are around.
    • You cannot declare a variable in a for loop, but you can initialize it.
    • If you want to create separate functions, do that above main() 
      • You do not need to make separate functions, but if you do, they must be declared before being used.
  4. Use scanf if you need user input (we'll talk about it Monday, but you can do man scanf to get info on it). This is not required.
Github link
https://github.com/mks65/euler.git
Comments