What's wrong with this program?
Check your output...it's not as per your expectation!!!
#include<stdio.h>
void State_Guj_print(){
printf("State - Gujarat India.\n");
}
void State_Maha_print(){
printf("State - Maharastra India\n");
}
void State_Madhya-Prad_print(){
printf("State - Madhya Pradesh India\n");
}
int main()
{
int num;
printf("Enter the number [1-3]:\n");
scanf("%d",&num);
switch(num)
{
case 1:
State_Guj_print();
break;
case 2:
State_Maha_print();
break;
case 3:
State_Madhya-Prad_print();
break;
default:
printf("Enter only number 1 to 3.\n");
break;
}
return 0;
}
/*
Do share your answer in comments...
*/
Check your output...it's not as per your expectation!!!
#include<stdio.h>
void State_Guj_print(){
printf("State - Gujarat India.\n");
}
void State_Maha_print(){
printf("State - Maharastra India\n");
}
void State_Madhya-Prad_print(){
printf("State - Madhya Pradesh India\n");
}
int main()
{
int num;
printf("Enter the number [1-3]:\n");
scanf("%d",&num);
switch(num)
{
case 1:
State_Guj_print();
break;
case 2:
State_Maha_print();
break;
case 3:
State_Madhya-Prad_print();
break;
default:
printf("Enter only number 1 to 3.\n");
break;
}
return 0;
}
/*
Do share your answer in comments...
*/