You guys are awesome. i am learning C language and i'm happy with the help i get from you guys. Anyway, based on your explanations i found another way to do it even though it is not a professional way of thinking but it works. Again you guys can look at this code and prolly suggest other ways to do it my simple easy way is like this:
Code:
#include <stdio.h>
#include <stdlib.h>
int main()
{
int a;
char b,c;
scanf("%d",&a);
switch (a) {
case 1: {
printf("1\n");
break;
}
case 2:{
printf("2\n");
break;
}
case 3: {
printf("3\n");
break;
}
case 4: {
scanf("%c",&c);
printf("enter a letter");
scanf("%c",&b);
switch(b){
case 'a': {
printf("a\n");
break;
}
case 'b':{
printf("b\n");
break;
}
default: {
printf("haha");
break;
}
}
break;
}
default: {
printf(" lol");
break;
}
}
getch();
return 0;
}