Answered Questions

  • Defect Report

    Write a defect report for this arithmetic issue. The program is supposed to add numbers properly and this is what you see:1+1=21+2=31+3=42+2=32+3=52+4=63+3=5Write a clear and concise description of the problem.

    Star Read Best Answer

    Editorial / Best Answer


    • Member Since Mar-2007 | Jan 13th, 2010


    Report of the above results: 
    The loop used for incrementing the first value is not implemented properly. on every 4th iteration, first value is not treated as appeared.
    See the highlighted values. In first highlighted calculation, still it is treating first value as '1' while calculating. and at last one it is treating it as '2' instead of 3.

    Asit Samal

    • Dec 1st, 2011

    Interviewer I think you are wrong because you have mentioned when X=Y then it is adding like: X+Y-1. But in case of 1+1=2 it is not adding like X+Y-1, rather it is adding as X+Y. So, ans should be : Except 1+1=2 in all other case it is adding like X+Y-1.