Git Product home page Git Product logo

assignment5's Introduction

Assignment5

Objectives

To gain experience writing functions and using recursion.

Part 1

  1. Write a program, recurseFibonacci.c, that uses a recursive function to print the first K Fibonacci numbers in sequence. In the Fibonacci sequence, each number is the sum of the 2 before it. The first 2 numbers in the sequence are 1.

  2. In a separate program, loopFibonacci.c, write the same Fibonacci sequence as a loop.

Part 2

In a text file assignment5.txt, answer the following questions:

  1. How would you call the following function? Give an example of what it would look like written inside of the main() function and explain your code in detail.
	int fxn(int a, float b, int c)
  1. Explain the difference between recursion and iteration. When/why is one preferable over the other? Why is recursion worse in other cases?

  2. How does a compiler work? Explain step by step.

Submission Guidelines

Please include your name and a description in a comment at the top of your code files. Please also include your name at the top of your assignment5.txt file.

All files must be submitted via GitHub by 10:00am 7/6.

assignment5's People

Contributors

lhsu92 avatar atmilich avatar clesleycode avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.