You are not logged in.

#1 2015-09-14 04:25:10

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
Website

Implementation Program:

C Programming Quizzes C Language Operators And Expressions

Directions:
What will be the output of this program on an implementation where int occupies 2 bytes?

Question:
#include <stdio.h>
void main()
{
      int i = 3;
      int j;
      j = sizeof(++i + ++i);
      printf("i=%d j=%d", i, j);
}

Option A):
the behavior is undefined
Option B):
i=4 j=2
Option C):
i=3 j=2
Option D):
i=5 j=2

Correct Answer is Option C):
i=3 j=2


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-09-14 04:25:10

Advertisement
Ads By Google

Re: Implementation Program:



Board footer