Answered Questions

  • What is the output of the following program:

    {geshibot language="c"}int main() { char a = 120, b = 140; int i; i = a + b; printf("%d", i); return 0; }{/geshibot} a) 260 b) 0 c) -1 d) 1

    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

    ish mahajan

    • Jan 16th, 2014

    260