20_10

Write a C Program to Calculate mean of 10 numbers.

Source code:

 //Write a C Program to Calculate mean of 10 numbers

#include <stdio.h>

int main()

{

int num[10];

    int  i, Number=10;

    int Mean, Sum=0;


    for(i=0; i<Number; i++)

    {

    printf("Enter the value for %d: ",i);

    scanf("%d", &num[i]);

    }

for(i=0; i<Number; i++)

    {

    Sum = Sum + num[i];

    }


    Mean = Sum/Number;

    printf("%d",Mean);

    return 0;

}

Output:

C Program to Calculate mean of 10 numbers


No comments:

Post a Comment

Write a program in C to convert a decimal number to binary using recursion.

 Source code: //Write a program in C to convert a decimal number to binary using recursion. #include<stdio.h> long convertB_to_D(int d...