Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int values[10], i, n, sum = 0, average;
- printf("Enter the number of elements you wish to add to the array: ");
- scanf("%d", &n);
- for(i = 0; i < n; i++){
- printf("Enter number: ", i);
- scanf("%d", &values[i]);
- sum = sum + values[i];
- }
- average = sum / n;
- printf("%d", average);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement