Posts

Showing posts with the label Switch

Switch Case Operations

Image
Today I want to write about switch-case statement in c. This statement is a totaly saver in some situation. However, It has a tricky point and before using that you should learn that tricky point. I want to explain it with an example code : #include <stdio.h> main() { int Grade = 'A'; switch( Grade ) { case 'A' : printf( "Perfect\n" ); case 'B' : printf( "Good\n" ); case 'C' : printf( "OK\n" ); case 'D' : printf( "Danger\n" ); case 'F' : printf( "Pr