0

Tell the output of below program

#include<stdio.h> void main(){ int a=1+2*2-1%2; printf("%d",a); }

24th Feb 2017, 8:41 AM
Abhishek Singh
Abhishek Singh - avatar
2 ответов
+ 4
* and % have higher precedence than + and -. So, (1) + (2 * 2) - (1 % 2) = 1 + 4 - 1 = 4 is the output.
24th Feb 2017, 12:05 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 1
4
24th Feb 2017, 9:27 AM
Raj Kumar Chauhan
Raj Kumar Chauhan - avatar