C program to add, average and deviation of numbers, C/C++ Programming

C program to add, average and deviation of numbers:

void main()

{

                int sum=0,a[10],i;

                float avg=0,dev,vari=0,var;

                printf("Enter 10 interger \n");

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

                {

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

                                sum=sum+a[i];

                }

                avg=sum*0.1;

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

                                var=var+pow((a[i]-avg),2);

                vari=var/10;

                dev=sqrt(vari);

                printf(" Sum = %d \n Avrage= %f \n Variance = %f \n Deviation = %f \n",sum,avg,vari,dev);

 

                getch();

 

}

1957_C program to add, average and deviation of numbers.png

Posted Date: 9/29/2012 7:30:35 AM | Location : United States







Related Discussions:- C program to add, average and deviation of numbers, Assignment Help, Ask Question on C program to add, average and deviation of numbers, Get Answer, Expert's Help, C program to add, average and deviation of numbers Discussions

Write discussion on C program to add, average and deviation of numbers
Your posts are moderated
Related Questions

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Create Complex number using constructor: class complex                                 {                                                   private:


Default Value Functions,  When declaring a function we can specify a default value for each parameter. This value will be used if that parameter is left blank when calling to the f

I am seeking a developer to create a mobile game for me. I want an endless runner game with simple controls. The game needs to be a 3D game in a 2D view. The graphics and animation

i wont to make triangle with number but number from the largest possible number to 01 (reversed).

What if I wish a local to "die" before the close} of the scope wherein it was created? Can I call a destructor on a local if I want to?

Declaration of Variables: Variables are declared as follows: int a; float b;   Assigning value to variables: int a = 100; Declaring and assigning is called ini

The Malt Shop restaurant charges $2.99 for burgers, $1.29 for fries, and $1.25 for sodas.  Write a program that allows a restaurant employee to enter an order (the number of bur