Question: What is going wrong with my C code? I can't run it. Here is the question for this: Write both C and Matlab scripts that

What is going wrong with my C code? I can't run it.
Here is the question for this:
Write both C and Matlab scripts that allow a user to navigate through the departments at
a company. The script should request a department code as an input. Print a statement
to the screen directing the user to the department corresponding to their input. An example
output message could say You selected: 3. You are now being redirected to the Accounting
department. Assume five departments. Account for what happens when a user inputs an
invalid department code.
First solve this problem using only if/else conditional statements. Then solve it using a
switch case syntax. These methods may be included in a single script. Print both outputs.
 What is going wrong with my C code? I can't run

men Navigate Editor Product Debug Source Control Window Help Neviete through the department My Mind Navigate through the department Ready Tedey x 12:55 AM mine Navigate through the department Navigate through the department meine Necion 8 #include 9 include 10 11 int main() 12 13 printf("please provide the department code: ; 14 scanf("%d", &code); Use of undece sentir code 15 printf("You selected: %d". code); w of underd identifier code 16 // 11-else sequene 17 if (code 1) Um of undeclared denne oder 18 19. printf(" you are being directed to the Depti "); 20 } 21 else if (code --2) Use of undeciend Identer code 22 23 printf("You are being directed to the Dept2 "); 24 ) 25 also if (code ==3) olundecidendier code 26 printf(" you are being directed to the Dept3 -> 27 else if (coder) Onderd 28 29 printf(" You are beibe directed to the Depts "); 30 } 82 else 33 34 printf(" Invalid department code! ! "); 35 ) 37 T 15 tvo SD)) @ MacBook Air

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!