You are not logged in.

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

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


Failure is the first step towards seccess.

2015-09-14 06:13:41

Advertisement
Ads By Google

Re: Executed Program:



\n

Board footer