在c语言中“ and”是一个内置关键字,至少从C ++ 98起就存在。它是&&(逻辑AND)运算符的替代方法,它通常与条件一起使用。

如果所有操作数的结果为1,and关键字返回1如果任何条件的结果为0,则返回0。

语法:

operand_1 and operand_2

这里,operand_1和operand_2是操作数。

示例

   Input:     a = 10     b = 20          result = (a==10 and b==20)     Output:     result = 1