You are not logged in.

#1 2015-09-14 06:13:39

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

Executed Program:

C Programming Quizzes C Language Function

Directions:
What will be printed when this program is executed?

Question:
int f(int x)
{
   if(x <= 4)
      return x;
   return f(--x);
}
void main()
{
   printf("%d ", f(7));
}

Option A):
Syntax error
Option B):
4
Option C):
4 5 6
Option D):
4 5 6 7

Correct Answer is Option B):
4


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

2015-09-14 06:13:39

Advertisement
Ads By Google

Re: Executed Program:



Board footer