You are not logged in.

#1 2015-09-15 05:37:35

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
Website

Output Program:

http://interviewquestionsanswers.org/quiz/C-Programming http://interviewquestionsanswers.org/qu … Structures

Directions:
What is the output of the following program?

Question:
#include<stdio.h>
int c[10] = {1,2,3,4,5,6,7,8,9,10};   
main()
{
   int a, b=0;
   for(a=0;a<10;++a)
      if(c[a]%2 == 1)
         b+=c[a];
   printf("%d", b);
}

Option A):
24
Option B):
25
Option C):
20
Option D):
30

Correct Answer is Option B):
25


Failure is the first step towards seccess.

2015-09-15 05:37:35

Advertisement
Ads By Google

Re: Output Program:



Board footer