#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);
}
Run Code Online (Sandbox Code Playgroud)
在编译程序之后,o/p是:
输入第一个关键字
我输入'$'并使用ctrl + z来eof并'enter'继续该程序.但即使没有输入第二个关键字,编译器也会将输出打印为
输入第二个关键字
正如我所料,它比' - >'更大'.'
任何人都可以帮助这个计划吗?
对不起,如果有任何语法或短语错误.