Thanks for your help earlier.. Here I am with a new problem facing the same output. scanf() is not working. I am using MACROs in it and this time format is correct LOL.. please have a look and tell me what am i doing wrong here. i am trying to take two characters as input and test whether they are "uppercase or not" or "lowercase or not". my program scans for ch1 but doesn't scan for ch2; i tried flushing the input using "fflush(stdin);" but still the same. when i printed the value of ch2 to see what it is taking in account it shows "10" that's where i tried to flush the input but still the same output. so please have a look and please tell me my mistake. I'll be very thankful.
#include <stdio.h>
#define UPPERCASE(x) {\
if(x>=65 && x<=90)\
printf("Uppercase letter\n");\
else printf("not Uppercase\n");}
#define LOWERCASE(x) {\
if(x>=97 && x<=122)\
printf("LOWERCASE LETTER\n");\
else printf("not lowercase\n");}
#define BIGGER(x,y) { \
if(x>y)\
printf("%d is biger\n",x);\
else printf("%d is bigger\n",y);}
int main()
{
char ch1,ch2;
int x,y;
printf("enter a UPPERCASE LETTER\n");
scanf("%c",&ch1);
UPPERCASE(ch1);
printf("enter a LOWERCASE LETTER \n");
fflush(stdin);
scanf("%c",&ch2);
LOWERCASE(ch2);
printf("enter two numbers\n");
scanf("%d%d",&x,&y);
BIGGER(x,y);
return 0;
}
Here my output