Question: C program For this homework assignment we will be working with if-statements and switch statements. Immediately below are the prototypes for the three functions Id

C program

For this homework assignment we will be working with if-statements and switch statements.

Immediately below are the prototypes for the three functions Id like you to define in the file hw3.c.

You MUST include hw3.h that I have uploaded for you in the starter code.

Just a reminder, do NOT include a main function. I already have a file called main.c that has a main function in it that you can use to see if your functions are working correctly.

int larger( int num1, int num2);

int smaller( int num1, int num2 );

int switch_larger_smaller( int choice, int num1, int num2);

Function larger should return the larger of the two parameters passed to it.

Function smaller should return the smaller of the two parameters passed to it.

Function switch_larger_smaller:

  • MUST use a switch statement
  • If choice is 1, call function larger, giving it num1 and num2 as parameters and return the result
  • If choice is 2, call function smaller, giving it num1 and num2 as parameters and return the result
  • For any other value of choice, return -1

C program For this homework assignment we will be working with if-statements

SubmitD DetailsBuild Run Grades Actions Rename Delete Copy File: work/hw3.c Files TerminalSource work/hw3.c l #include "hv3.h" //DO NOT RENOVE THIS INCLUDE STATEMENT work hw3.c hw3.h main.c ccc vl w db f8a 40660b16:$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!