码迷,mamicode.com
首页 > 其他好文 > 详细

与和或的优先级问题

时间:2015-06-10 22:12:26      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:

    事实上与的优先级要大于或,可以举个例子

  
#include<stdio.h> 
void main()
{
int a = 0,b = 1,c = 2;
if(c>0 || b>0 && a>0)
printf("this is a C program.\n");
}

上面这个程序输出的是 this is a C program.
所以可以说明 && 的优先级大于 ||

与和或的优先级问题

标签:

原文地址:http://www.cnblogs.com/beike303603/p/4567312.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!