# H int main int a 7 b 12 c int c b a 5

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Executes all Prefix Operations Before evaluation of expression Evaluation of expression Evaluation Executes all Postfix Operations /* prefix operators */ #include<stdio.h> int main() { int a = 7, b = 12, c; int c = b * (++a) + 5 * (++a); (++a) printf(“ a = %d”, a); printf(“ printf(“\n b = %d”,b); printf(“\n printf(“\n c = %d”,c); printf(“\n } Output: a=9 b = 12 12 c = 153 ( 12 * 9 + 5 * 9) 153 After evaluation of expression and before leaving the statement /* prefix and postfix operators */ #include<stdio.h> int main() { int a = 7, b = 12, c; int c = b * (a++) + 5 * (++a); (a++) printf(“ a = %d”, a); printf(“ printf(“\n b = %d”,b); printf(“\n printf(“\n c = %d”,c); printf(“\n } Output: a=9 b = 12 12 c = 136 ( 12 * 8 + 5 * 8) 136 /* postfix operators */ #include<stdio.h> int main() { int a = 7, b = 12, c; int c = b * (a++) + 5 * (a++); (a++) printf(“ a = %d”, a); printf(“ printf(“\n b = %d”,b); printf(“\n printf(“\n c = %d”,c); printf(“\n } Output: a=9 b = 12 12 c = 119 ( 12 * 7 + 5 * 7) 119 Bitwise Logical Operators Bitwise & -- Bitwise AND A B A&B A|B A^B ~A 1 1 1 1 0 0 1 0 0 1 1 0 ^ -- Bitwise XOR 0 1 0 1 1 1 ~ -- Bitwise NOT 0 0 0 0 0 1 | -- Bitwise OR Bitwise AND Bitwise OR A (42) : 00000000 00101010 B (15) : 00000000 00001111 ----------------------------------& (10) : 00000000 00001010 ----------------------------------- A (42) : 00000000 00101010 B (15) : 0000000...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online