#include <stdio.h>
#include <stdlib.h>
int main()
{
char a,b;
printf("enter the firstkeyword \n");
a = getchar();
printf("enter your second keyword \n");
b = getchar();
if(a>b)
{
printf("it is '%c' greater than '%c' as i expected \n",a,b);
}
else if (b>a)
{
printf("here'%c'is greater than '%c' \n",b,a);
}
else
{
printf("dont type the same character twice in next session \n");
}
return(0);
}
after compiling the program the o/p is:
enter the first keyword
I entered '$' and used ctrl+z to eof and 'enter' to continue the program. But even without entering the second keyword the compiler printing the output as
enter your second keyword
it is '$' greater than '->' as i expected
Can anyone help with this program?
Sorry if any grammatical or phrase errors.