Look at your code: What happens to
s
each time round the loop?
What happens to the previous versions? Shouldn't they be included in the final total?
Change this line:
s=(u*i)+(0.5*a*i*i);
To this:
s+=(u*i)+(0.5*a*i*i);
Then initialise
s
to zero before the loop, and move the printing and pausing code out of the loop!
To be honest, two minutes with the debugger would have shown you what you were doing wrong and enabled you to fix this 12 hours ago. Get used to the debugger, learn to use it on trivial code like this, and you will have a tremendous advantage when your code becomes more complex! How you use it depends on your compiler system, but a quick Google for the name of your IDE and "debugger" should give you the info you need.
Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.