Start by looking at the error message - begin with the first one, as a simple error can cause multiple problems to be reported.
Compiling your code with an online service gave this as the first error:
main.c: In function ‘main’:
main.c:40:3: warning: implicit declaration of function ‘sum’; did you mean ‘sum3’? [-Wimplicit-function-declaration]
40 | s=sum(s);
| ^~~
| sum3
So, look at the error report: it's "main.c", line 40, column 3, and the problem it found was
implicit declaration of function ‘sum’; did you mean ‘sum3’?
Look at the code - and the error report shows it as:
s=sum(s);
a quick look though your code doesn't show a function called
sum
, just
sum1
,
sum2
, and
sum3
- so you need to decide which of those you should be calling - and since sum3 requires parameters, it's unlikely to be that one!
You should expect to get syntax errors every day, probably many times a day while you are coding - we all do regardless of how much experience we have! Sometimes, we misspell a variable, or a keyword; sometimes we forget to close a string or a code block. Sometimes the cat walks over your keyboard and types something really weird. Sometimes we just forget how many parameters a method call needs.
We all make mistakes.
And because we all do it, we all have to fix syntax errors - and it's a lot quicker to learn how and fix them yourself than to wait for someone else to fix them for you! So invest a little time in learning how to read error messages, and how to interpret your code as written in the light of what the compiler is telling you is wrong - it really is trying to be helpful!
So read this:
How to Write Code to Solve a Problem, A Beginner's Guide Part 2: Syntax Errors[
^] - it should help you next time you get a compilation error!
And spending a little time learning to understand syntax error messages will save you a huge amount of time in future: you waited at least 20 minutes for this reply, then your email system probably added another 10 minutes or so, plus the time it took you to type up the question once you had found this site and created an account. Chances are that you could have saved a significant chunk of that time if you knew how to read them!
I'm not saying we don't want to help you fix them - sometimes I can't see my own errors because I read what I meant to write - but fixing syntax errors is part of the job, and if you can't do it for yourself people are going to look at you as a bit weird should you get a job in the industry!