Switch Letter - break;

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// This program demonstrates switch statements using characters as switch cases #include <stdio.h> void main() { char grade; printf("Enter a grade "); scanf("%c",&grade); switch(grade) { case'E':case'e':printf("Excellent\n");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: break; case'S':case's':printf(&quot;Satisfactory\n&quot;); break; case'U':case'u':printf(&quot;Unsatisfactory\n&quot;); break; default:printf(&quot;Invalid input\n&quot;); } }...
View Full Document

Ask a homework question - tutors are online