Home » NO IDEA » Printing the single Digit number using switch case

Printing the single Digit number using switch case

Blog Stats

  • 13,912 hits
December 2013
M T W T F S S
« Oct   Jan »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  
#include<stdio.h>
int main()
{
	printf("\n Printing the digit by accepting the number");
	printf("\n Enter the digit");
	int x;
	scanf("%d",&x);
	switch(x)
	{
		case 1:
		printf("\n The number is one");
		break;
		case 2:
		printf("\n The number is Two");
		break;
		case 3:
		printf("\n The number is Three");
		break;
		case 4:
		printf("\n The number is Four");
		break;
		case 5:
		printf("\n The number is Five ");
		break;
		case 6:
		printf("\n The number is Six");
		break;
		case 7:
		printf("\n The number is Seven");
		break;
		case 8:
		printf("\n The number is Eight");
		break;
		case 9:
		printf("\n The number is Nine");
		break;
		default:
		printf("\n wrong one digit sorry Exited!!!");
	}
	return 0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: