bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

APC-S-013.c (670B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* Write a fuction to calculate the average of an array */
      8 /* Author: Amit Dutta, Date: 26-11-2025 */
      9 
     10 #include <stdio.h>
     11 
     12 double average(int []);
     13 
     14 int main()
     15 {
     16     int marks[10], i;
     17     printf("\nEnter 10 numbers: \n");
     18     for (i = 0; i <= 9; i++)
     19     {
     20         printf("Enter number %d: ", i + 1);
     21         scanf("%d", &marks[i]);
     22     }
     23     printf("\nAverage = %g", average(marks));
     24     return 0;
     25 }
     26 
     27 double average(int marks[10])
     28 {
     29     int sum = 0;
     30     for (int i = 0; i <= 9; i++)
     31         sum += marks[i];
     32     return sum / 10.0;
     33 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror