in Programming in C retagged by
1,218 views
5 votes
5 votes

What will be output if you will compile and execute the following C code?

void main(){
char c=125;
c=c+10;
printf("%d",c);
}
  1. $135$
  2. $115$
  3. $-121$
  4. $-8$
in Programming in C retagged by
by
1.2k views

1 Answer

3 votes
3 votes
Option c.

Bcz char take one byte to store a variable.

It's range - 128 to 127.but in the above code the c=c+10 =135.

So 135-127=8

Decrease 8 from - 128

So the answer is - 121

1 comment

right
0
0
Answer:

Related questions