Embed presentation
Downloaded 30 times




The document contains instructions and code snippets for 5 exercises involving functions and switch case statements in C programming. Exercise 1 demonstrates a simple function that adds two numbers and returns the result. Exercise 2 defines a function without arguments that gets user input, calculates a sum, and prints the output. Exercise 3 defines a function that takes 3 arguments, finds the maximum value, and returns it. Exercise 4 contains a switch case statement to print a color based on user input. Exercise 5 instructs the user to write a program to calculate electrical bills based on consumption tiers using input, switch case, if-else, and loops.


