c語言中and是關鍵字嗎

來源:魅力女性吧 2.22W
c語言中and是關鍵字嗎

在c語言中“ and”是一個內置關鍵字,至少從C ++ 98起就存在。它是&&(邏輯AND)運算符的替代方法,它通常與條件一起使用。

如果所有操作數的結果為1,and關鍵字返回1如果任何條件的結果為0,則返回0。

語法:

operand_1&nbspand operand_2

這裏,operand_1和operand_2是操作數。

示例

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

熱門標籤