MCPcopy Create free account
hub / github.com/CodeWithHarry/The-Ultimate-C-Programming-Course / main

Function main

Chapter 3/07_switch.c:3–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1#include <stdio.h>
2
3int main(){
4 int a;
5 printf("Enter a: ");
6 scanf("%d", &a);
7
8 switch(a){
9 case 1:
10 printf("You entered 1\n");
11 break;
12 case 2:
13 printf("You entered 2\n");
14 break;
15 case 3:
16 printf("You entered 3\n");
17 break;
18 case 4:
19 printf("You entered 4\n");
20 break;
21 default:
22 printf("Nothing matched");
23 }
24 return 0;
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected