C语言中的关系运算符是什么?!
这些用于比较两个表达式。
关系表达式输出为真(1)(或)假(0)。
算法
按照下面给出的算法-
START Step 1: Declare integer variables. Step 2: Read all variables at runtime. Step 3: Perform relational operations. i. ab iv. a>=b v. a==b vi. a!=b Step 4: Print all computed values.
示例
以下是计算关系运算符的C程序-
#include输出结果main (){ int a,b; printf("enter a,b values:\n"); scanf("%d%d",&a,&b); printf("%d\n",ab); printf("%d\n",b>=a); printf("%d\n",a==b); printf("%d\n",a!=b); }
您将看到以下输出-
enter a,b values: 120 340 1 1 0 1 0 1
热门推荐
10 新人红包祝福语简短精辟
11 幼师给毕业祝福语简短
12 生日高考祝福语妹妹简短
13 下飞机祝福语简短英文
14 元宵发客户祝福语简短
15 爸妈金婚文案祝福语简短
16 新郎朋友红包祝福语简短
17 虎年五一祝福语大全简短
18 出阁宴祝福语姐姐简短