arraysum
Submit solution
Java
Points:
10 (partial)
Time limit:
1.0s
Memory limit:
64M
Author:
Problem type
Allowed languages
Write a program to print the sum of n numbers Note :Use array
Test Case Input : Enter the total count(n): 5
Enter n1: 1
Enter n2: 2
Enter n3: 3
Enter n4: 4
Enter n5: 5
Output : The sum is : 15
Comments
include<stdio.h>
int main() { //let's assume the maximum array size as 100. //initialize sum as 0. Otherwise, it will take some garbage value. int arr[100], size, i, sum = 0;
}