You are not logged in.

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

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

Output Program:

C Programming Quizzes C Language Control 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


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

2015-09-15 05:37:32

Advertisement
Ads By Google

Re: Output Program:



Board footer