Please take a look at my errors in my code. I would greatly appreciate a second
ID: 3870747 • Letter: P
Question
Please take a look at my errors in my code. I would greatly appreciate a second look at this code. Thank you.
Errors:
My code:
stocks for.c: In function 'main stocks_for.c:27:44: error: 'currentStock' undeclared (first use in this function) float meansum = 0, varian ceSquareSum= 0; currentStock; each undeclared identifier is reported only once for eac h function it appears in stocks_for.c:33:8: warning: missing terminating character enabled by default] scanf ( ' %c ", & ch) ; stocks_for.c:33:2: error: missing terminating ' character scanf ( ' %c ", &ch;) ; stocks_for.c:35:2: error: expected expression before 'if stocks_for.c:74:10: warning: missing terminating " character [enabled by default] scanf("%f, ¤tStock;) ; stocks for.c:74:4: error missing terminating "character scanf ("%f, &CurrentStock;); stocks_for.c:108:1: eror: expected before tokenExplanation / Answer
1. In line 28, you have not declared type of currentStock maybe there is ',' instead of ';'after variableSquareSum = 0
2. In line 39, in scanf function you have used (') to start and (") to end which gives the error. Use (") both times
3. In line 74, in scanf function, you have used (") only once but did not end. Please check.