You are not logged in.

#1 2015-09-16 04:53:48

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

C Language Arrays And Strings:

C Programming Quizzes C Language Arrays And Strings

Directions:
#include<stdio.h>
void main()
{
    int a[5] = {5, 1, 15, 20, 25};
    int i, j, m;
    i = ++a[1];
    j = a[1]++;
    m = a[i++];
    printf("%d, %d, %d", i, j, m);
}

Question:
What will be the output of the program?

Option A):
1, 2, 5
Option B):
3, 2, 15
Option C):
2, 1, 15
Option D):
2, 3, 20

Correct Answer is Option B):
3, 2, 15


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

2015-09-16 04:53:48

Advertisement
Ads By Google

Re: C Language Arrays And Strings:



Board footer