5,131 views

1 Answer

Best answer
1 votes
1 votes
By default its signed so we can get -121 as result

since 125+10 initally 125+2 =127 when 127+1=-128(we move to -ve values) because for char the range is from -128 to +127

So 125+10=-121

if it is unsigned char then we get 125+10=135
selected by

Related questions

0 votes
0 votes
1 answer
1
Desert_Warrior asked May 16, 2016
2,311 views
#include<stdio.h int main() { int a = 5; int b = ++a * a++; printf("%d ",b); return 0; }(a) 25 (b) 30 (c) 36 (d) Undefined Behavior
0 votes
0 votes
2 answers
2
Desert_Warrior asked May 16, 2016
8,789 views
#include<stdio.h int main() { int a = 5; switch(a) { default: a = 4; case 6: a ; case 5: a = a+1; case 1: a = a-1; } printf("%d \n",a); return 0; }(a) 5 (b) 4 (c) 3 (d) N...
0 votes
0 votes
1 answer
4
Desert_Warrior asked May 16, 2016
1,538 views
#include<stdio.h int main() { int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater"); else printf("Lesser"); return 0; }(a) Equal (b) Greater ...