C++入门经典-例2.12-求逻辑表达式的值

1:代码如下:

// 2.12.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include<iostream>
using namespace std;
void main()
{
    int i=5,j=8,k=12,l=4,x1,x2;
    x1=i>j&&k>l;
    x2=!(i>j)&&k>l;
    printf("%d,%d
",x1,x2);
}
View Code

运行结果

原文地址:https://www.cnblogs.com/lovemi93/p/7505677.html