You are not logged in.

#1 2015-09-17 05:53:09

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

C Language Basic Quiz Question.

C Programming Quizzes C Language Basic

Directions:
Determine Output:

Question:
void main()
{
      int c[] = {2.8,3.4,4,6.7,5};
      int j, *p=c, *q=c;
      for(j=0;j<5;j++){
            printf(" %d ", *c);
            ++q;
      }
      for(j=0;j<5;j++){
            printf(" %d ", *p);
            ++p;
      }
}

Option A):
2 3 4 6 5 2 3 4 6 5
Option B):
2 2 2 2 2 2 3 4 6 5
Option C):
2.8 3.4 4 6.7 5 2.8 3.4 4 6.7
Option D):
2.8 2.8 2.8 2.8 2.8 2.8 3.4 4

Correct Answer is Option B):
2 2 2 2 2 2 3 4 6 5


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

2015-09-17 05:53:09

Advertisement
Ads By Google

Re: C Language Basic Quiz Question.



Board footer