2018-09-07 First C Program

posted Sep 7, 2018, 10:24 AM by Konstantinovich Samuel
  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 run  $ man scanf from the command line to get info on it). This is not required.