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

i think you need to cope the questions to a word file, so you can read the neumb

ID: 651278 • Letter: I

Question

i think you need to cope the questions to a word file, so you can read the neumbers

q.Write a program in MARIE to read in 3 numbers, print the numbers in order read in (first in to last in), print a zero, sort them high to low, and print them again(in order high to low). (No arrays)                   Sample output:   17     Sample input:         17

39                                 39

32                                 32

0

39

32

17

q.Write a program to calculate a Fibonacci number given n, Fibonacci numbers are defined as the sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34,

Explanation / Answer

The following program may be helpful.

#include<stdio.h>

int Fibonacci(int);

main()

{

   int n, i = 0, c;

   scanf("%d",&n);

   printf("Fibonacci series ");

   for ( c = 1 ; c <= n ; c++ )

   {

      printf("%d ", Fibonacci(i));

      i++;

   }

   return 0;

}

int Fibonacci(int n)

{

   if ( n == 0 )

      return 0;

   else if ( n == 1 )

      return 1;

   else

      return ( Fibonacci(n-1) + Fibonacci(n-2) );

}