Doubt regarding the Fibonacci problem

https://ide.codingblocks.com/s/53430
The output is correct but after submission, it is showing wrong…
Why??

Paste your code on IDE and share the llink.

Hey Nadeem, you code give output 0 and 1 if I input value of n=0 but it should give only 0 output

I have pasted on IDE

Hey, you are making just a small mistake as Nitin have mentioned, when input is 0 you should print 0 only but your code is printing 0 and 1 both. So, to correct this update your code like this:

if(n==0){
  cout<<i<<endl;
}
if(n>0){
 cout<<j<<endl;
}

use this code snippet instead of directly printing i and j at starting.