Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CS 2050 Lab Assignment 3 SUMMER 2018 FAILURE TO RETURN THIS DOCUMENT TO THE TA W

ID: 3906799 • Letter: C

Question

CS 2050 Lab Assignment 3 SUMMER 2018 FAILURE TO RETURN THIS DOCUMENT TO THE TA WILL RESULT IN A ZERO GRADE FOR THE LAB Purpose: . Practice recursion Submission information: Submit this assignment by following the instructions given by your TA. SUBMIT ONLY the c file (no a.out or executable file is required). All the lab assignments must be submitted before the end of the lab. Use the following submit command $ submit s submit Cs1050 2050LAB3 e-lab3.c Filename must be: sectionletter-lab3.c (Include your respective lab section) e.g. a-lab3.c or b-lab3.c Description For this lab assignment you will write a C program that recursively generates the Greatest Common Denominator of two numbers and recursively generates n numbers of the Fibonacci sequence. You will store the user inputs into a structure with the ged of the two inputs and the xth element of the fibonacci sequence. Be careful using large numbers here. If the first user input is 100, then you will have to wait for r program to recursively generate the 100 element of the fibonacci sequence. As numbers get large, this can be time consuming. You are encouraged to typedef your structure. Include the following structure definition at the top of your program: struct storage t int x;// first user input int y; I/ second user input int ged: II gcd of x and y int fib:// xth element of the fibonacci sequence Implement the following functions: int ged( int a, int b); The ged function takes two integers and returns their greatest common denominator. The greatest common denominator of two numbers is the largest possible integer number that divides both numbers.

Explanation / Answer

In any c program main function is the primary function that is called.

Main Function::

write_to_file funtion::

These are the tasks done by the two functions.

I think I explained everything you need about the functions.