Output of the Program

0

main()
{
int a,b,c,d;
a=3;
b=5;
c=a,b;
d=(a,b);
printf(“%d %d” , c,d);
}

a) 3 5
b)5 5
c)3 3

Ravi Garg edited question
    0
    Bharat Kul Ratan (anonymous)

    yeah, a is correct. c =a would give c=3 and d=(a,b) would change d to 5.

    Bharat Kul Ratan answered
      0
      Ashish Gaur (anonymous)

      Option a

      Ashish Gaur answered
        0
        Tanusree Ray (anonymous)

        given ans a. xplain

        Tanusree Ray answered
          0
          Tanusree Ray (anonymous)

          i didnt get the assignmen of d.. how its being assignd 5?

          Tanusree Ray answered
            0
            Bharat Kul Ratan (anonymous)

            d is assigned 5 as (a,b) would be executed first due to parentheses. and comma operator works from left to right. so finally b will be assigned to d.

            Bharat Kul Ratan answered
              Add image to editor add image from link

              Question stats

              • Active
              • Views805 times
              • Answers7 answers
              • Followers1 follower
              Question and answer is powered by AnsPress