C Programming Noob - Need Help Plz.
I have an assignment but don't have a clue what to do. It's a maths course so the problems are all maths related. Any help greatly appreciated. Here's the first question.
1. Write a program that reads from keyboard an ‘int’ number n, then reads n ‘double’ numbers xi and
prints their sum and their product
(summation)from i=1 to n of xi,
(product) from i=1 to n of xi
The program should check that all values are valid.
The commands we've learned so far are printf, scanf, if, for, while and else. There might be a few more but I'm not sure.
The code should start off like this:
# include <stdio.h>
# include <math.h>
void main(){
}
I would probably start off with
printf("Please enter a list of integers: ")
After that I'm stuck. Thanks for any help you can give me.
|