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 教师闺蜜祝福语简短