+ 2
Fibonacci Sequence not Giving Proper Output
Fibonacci Series in C Language. I tested the Code in Turbo++, it worked successfully without an error but when I tested it in SoloLearn Code Playground, it is showing error. https://code.sololearn.com/ca211487a23A/?ref=app
4 Answers
+ 11
Here conio. h header is not used
#include<stdio.h>
Int main() {
int i, n, t1=0, t2=1, t3;
printf("enter the number of terms");
scanf("%d", &n);
printf("fibonacci series");
for(i=0;i<n;i++){
printf("%d,", t1);
t3=t1+t2;
t1=t2;
t2=t3;
}
Return 0;
}
fixed your code
+ 5
Abhijith KS Most welcome
+ 2
Thank you Aysha!
It worked successfully
+ 1
Your code is not working in SoloLearn C Playground because there is no "conio.h" library on the server. I removed "conio.h" lines:
https://code.sololearn.com/cMrFsJwInFi0/?ref=app