This topic contains 0 replies, has 0 voices, and was last updated by  EduGorilla 1 year, 11 months ago.

  • Author
    Posts
  • #743067 Reply
     EduGorilla 
    Keymaster
    Select Question Language :


    What is the output of the following C program?
                void fun (int * p)
                {
                int i, sum = 0:

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (i = 2; i < 4; + + i)
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sum + = *(p+ i);
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf (&quot;%d&quot;, sum);
    }
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void main ( )
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int a[5] = {10, 20, 30, 40, 50};

    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fun (a + 1);
    }

    Options :-

    1. 90
    2. 120
    3. 130
    4. 140
    Post your Training /Course Enquiry
    Are You looking institutes / coaching center for
    • IIT-JEE, NEET, CAT
    • Bank PO, SSC, Railways
    • Study Abroad
    Select your Training / Study category
Reply To: What is the output of the following C program?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp….
Your information:




GET UPTO 50%    OFF!
Verify Yourself




Log in with your credentials

or    

Forgot your details?

Create Account