What is the output of the following program:

Code
  1. span style="color: #ff0000;">"%d"
Copyright GeekInterview.com

a) 260
b) 0
c) -1
d) 1

Questions by lalithakasiraj

Showing Answers 1 - 13 of 13 Answers

deepti mahajan

  • Jan 24th, 2013
 

a) 260

  Was this answer useful?  Yes

lakhpat

  • Mar 3rd, 2013
 

A=120
b=-116...(signed char range ie 127 to -128...... so 140 convert into -116).
c=a+b(120+(-116));
c=4;

Code
  1. #include<stdio.h>

  2. #include<conio.h>

  3. "%d%d%d"

it will be 4;
der is no any option unfortunately;
bcoz a=120 and b=140 but b can,t exceed 127. after 127 it will be -128,-127,-126.......up to -116;
so updated a and b will be 120, -116 respectively;
so final value will be 4:

  Was this answer useful?  Yes

gjkb

  • Nov 12th, 2013
 

260

  Was this answer useful?  Yes

kadukuntla rambabu

  • Nov 21st, 2013
 

options are wrong ,correct answer is 4.

  Was this answer useful?  Yes

nani

  • Nov 22nd, 2013
 

option (1).260....

  Was this answer useful?  Yes

ANBARASAN R

  • Nov 25th, 2013
 

4

  Was this answer useful?  Yes

nanirajesh gullapalli

  • Jan 6th, 2014
 

260

  Was this answer useful?  Yes

ish mahajan

  • Jan 16th, 2014
 

260

  Was this answer useful?  Yes

Surajsingh Rajput

  • Feb 12th, 2014
 

the answer is 4. because range of char is -128 to 127 so at 140 it get considered as 127,-128,-127,-126,....,-116.
so 120+(-116)=4

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions