Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Q17-Given an array A[] of size N, containing positive integers. You need to print the sum and mean (floor value) of given numbers.
- Ans-static void SumAndMean(int arr[],int N){
- int Sum=0;
- int mean;
- for(int i=0;i<N;i++)
- {
- Sum=Sum+arr[i];
- }
- mean =(Sum/N);
- System.out.println(Sum + " " + mean);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement