You are not logged in.

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

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
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


Failure is the first step towards seccess.

2015-09-16 04:53:49

Advertisement
Ads By Google

Re: C Language Arrays And Strings:



\n

Board footer