Skip to main content
Logo image

Section 14.11 Computer Languages

How did we choose the computer languages studied in this class? Why C? Why Matlab? Watch this video to find out:

Check Your Understanding Check Your Understanding

1.

Let’s start with a review question...
You just wrote the following program:
#include <stdio.h>
int myrecursion(int i, int j);

int main(void)
{
     int a;
     a = myrecursion(24,7);
     printf("%d\n", a);
     return(0);
}

int myrecursion(int i, int j)
{
  if (i>j)
    return myrecursion(i-j, j);
  else
    return(i);
}
What is the value of the variable a that is printed to the screen at the end of the program? Choose one: 3 / 7 / 10 / 17 / 24
How many times is the function myrecursion() called during execution of this program? Choose one: 1 time / 2 times / 3 times / 4 times / 5 times
Feel free to use the window below to experiment. You may want to add some printf() statements inside the recursive function to be able to track its behavior. Be sure to work the correct answer out "by hand" first before verifying your answer using the code window.

admin.....open in new window

Enter your two answers, separated by a comma, i.e. 30, 8 times:

2.

Please arrange the following computer languages from lowest to highest level:
C, machine language, assembly language, MATLAB, Java