ExamVeda
Login
Home
This question belongs to C Program C Miscellaneous
C Miscellaneous
?

Determine Output:
void main()
{
      int i = abc(10);
      printf("%d", --i);
}
int abc(int i)
{
      return(i++);
}

Answer & Solution
Correct Answer: Option B

"return(i++)", it will first return i and then increment it. i.e. 10 will be returned.

Examveda
Question posted by Examveda
Community

Join the Discussion

4 Comments
Poorvi Patil
Poorvi Patil 4 years ago
it'll be 9
coz --i will be printed , value of i is 10 hence --i=9
Deependra Singh
Deependra Singh 5 years ago
the answer should be compilation error as the function abc() is not defined/declared before main(). The compiler will return unidenfitied abc() error.
WG KIM
WG KIM 7 years ago
I believe it happens compile error which needs the declaration before using a function.
Neha Yadav
Neha Yadav 8 years ago
wa t is the ans ???? is it 10 or 9 ?