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
Reference Types The symbol "&" is interpreted as an address operator as well as AND operator. This operator is also used to declare a "reference variable". A reference is refer

Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.

Compiler Design - Limit In The Method Instructions


Create Complex number using constructor: class complex                                 {                                                   private:

A: Mostly can be overloaded. The only C operators which can't be are. and?: (and sizeof, that is technically an operator). C++ adds a few of its own operators, mostly which can be

what are objects or simply define objects

convert lower case to uper case

i am using otlv4 for database connecttvity, while i try to get all tables list from current database using query "$SQLTables" no output is displayed though programe compiles coretl

# include stdio.h> # include conio.h> # include string.h> void main()   {           int i=0,j=0;           char a[100],temp;           clrscr();