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

Presently we are using several spreadsheets to give weekly activity and income reports. Much of the information is being frequently re-keyed into several spreadsheets - we are look

A constructor that accepts one argument of a dissimilar type.

find area under the curve y=f(x) between x=a &y=b integrate y=f(x)

Define the Bitwise Operators in c language? C has distinction of supporting special operators that known as bit wise operators for manipulation of data at bit level. These oper

A: No. If they're utilized properly, they increase encapsulation. You frequently require splitting a class in half while the two halves will have distinct numbers of instances o


write a c++ program for minimum shelf downloads

find the area of a curve y=f(x) between x=a and x=b integrate f(x) between limits a and b   #include float start_point, /* GLOBAL VARIABLES */

Optimized NIC Driver for Windows Compact 7 for Hard Real Time Communication Project Description: I am seeking an optimized driver (miniport driver) that will be used for sele