0

I can't find my error ?? code on series of 1+1/2+1/3.....1/n .

https://code.sololearn.com/ctNaGpCpbWtO/?ref=app

1st Nov 2018, 10:52 AM
Lata Mishra
Lata Mishra - avatar
6 Respuestas
+ 2
As I said, your calculatuions are not correct. Also your prints do not show the / And in your first loop the condition is wrong now. Please put some effort in it and ask again later, ok? It's not that hard. Go through your code step by step.
1st Nov 2018, 11:54 AM
Matthias
Matthias - avatar
+ 1
There is still a comma instead of semicolon in line 14, also i<1 makes the loop stop at the beginning. In line 9 don't put semicolon after for-loop header
1st Nov 2018, 11:36 AM
Matthias
Matthias - avatar
+ 1
Program is running now but it is always showing 12 after giving any input in a program why??
1st Nov 2018, 11:45 AM
Lata Mishra
Lata Mishra - avatar
+ 1
Thanks for help i will try if i can make it correct
1st Nov 2018, 11:57 AM
Lata Mishra
Lata Mishra - avatar
0
There are a lot of syntax errors. In for loops you need semilocons, like for(i=1;i<n;i++){ } And in print statements you need commas printf("%d",i); Also not that division is done by forward slash / and not backward slash \ The error messages tell you on which lines you can find the mistakes. Additionally your computation is not correct.
1st Nov 2018, 11:14 AM
Matthias
Matthias - avatar
0
See now still error in code
1st Nov 2018, 11:19 AM
Lata Mishra
Lata Mishra - avatar