Advertisement
mogul_khan1018

CodingChallenge1

Sep 20th, 2020 (edited)
767
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. main(){
  4.      
  5.     int array[] = {1,3,9,15,90};
  6.     int i, sum;
  7.      
  8.     for(i = 1; i < 5; i++){
  9.         sum = array[0] += array[i];
  10.     }
  11.    
  12.     float avg = (float)sum / i;
  13.     printf("%.1f", avg);
  14. }
Advertisement
RAW Paste Data Copied
Advertisement