Determine Output:
void main()
{
int i = abc(10);
printf("%d", --i);
}
int abc(int i)
{
return(i++);
}
void main()
{
int i = abc(10);
printf("%d", --i);
}
int abc(int i)
{
return(i++);
}
A. 10
B. 9
C. 11
D. None of These
Answer: Option B
Solution(By Examveda Team)
"return(i++)", it will first return i and then increment it. i.e. 10 will be returned.
Join The Discussion
Comments ( 4 )
Related Questions on C Miscellaneous
Determine output:
void main()
{
int const *p=5;
printf("%d", ++(*p));
}
A. 6
B. 5
C. Garbage Value
D. Compiler Error
A. mmm nnn aaa
B. mmmm nnnn aaaa
C. Compiler Error
D. None of These
A. I hate Examveda
B. I love Examveda
C. Error
D. None of These
Determine Output:
void main()
{
static int var = 5;
printf("%d ", var--);
if(var)
main();
}
A. 5 5 5 5 5
B. 5 4 3 2 1
C. Infinite Loop
D. None of These
it'll be 9
coz --i will be printed , value of i is 10 hence --i=9
the answer should be compilation error as the function abc() is not defined/declared before main(). The compiler will return unidenfitied abc() error.
I believe it happens compile error which needs the declaration before using a function.
wa t is the ans ???? is it 10 or 9 ?