Switch Case
Switch Case
int main ()
case 1:
break;
case 2:
case 3:
break;
return 0;
Write a C program to read any day number in integer and display the day
name in word format.
#include <stdio.h> // Include the standard input/output header file.
void main()
printf("Input Day No : "); // Prompt the user to input the day number.
case 1:
break;
case 2:
printf("Tuesday \n"); // Print the corresponding day for day
number 2.
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
default:
break;
E Excellent
V Very Good
G Good
A Average
F Fail
void main()
{
case 'E':
break;
case 'V':
break;
case 'G':
strcpy(notes, " Good "); // Copy corresponding note for grade 'G'.
break;
case 'A':
break;
case 'F':
break;
default :
break;
If bill exceeds Rs. 400 then a surcharge of 15% will be charged and the
minimum bill should be of Rs. 100/-
#include <stdio.h> // Include the standard input/output header file.
void main()
printf("Input the name of the customer :"); // Prompt user for input of
customer name.
printf("Input the unit consumed by the customer : "); // Prompt user for
input of consumed units.
else
printf("\nElectricity Bill\n");