1.
main() { printf("%x",-1<<4); }
2.
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
Depending on the machine implementation it will result in FFFFFF0 (for 32bit ) or FFF0 (16 bit )
I = 0 . In the expression !i>14 , NOT (!) operator has more precedence than ? >? symbol. ! is a unary logical operator. !i (!10) is 0 (not of true is false). 0>14 is false (zero).
#include<stdio.h> int main() { int n; for(n = 7; n!=0; n--) printf("n = %d", n--); getchar(); return 0; }
input: one two three
output: three two one
void main(){ int i=320; char *ptr=(char *)&i; printf("%d",*ptr); }
Please provide your explanation also?
#include<stdio.h> main() { int a=10; printf("%d\n",a++==a); }
Output should be 1 but it is coming as 0, Can anyone please explain?