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

Assignment Help:

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


Related Discussions:- C program to add, average and deviation of numbers

Area under the curve, Area under the curve Write a program to find the area...

Area under the curve Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve bet

String, what is a string?

what is a string?

Class and object, how to write c++ code for financial system using class an...

how to write c++ code for financial system using class and object

Program for manage the tasks of a robot, Consider a group of n robots, numb...

Consider a group of n robots, numbered R2D1 through R2Dn, and m tasks, numbered 1 through m. Tasks can be different and robots are specialized, hence a given robot can only perform

Program to multiply 2 complex no.s - c++ program, THIS PROGRAM IS TO MULTIP...

THIS PROGRAM IS TO MULTIPLY THE TWO COMPLEX NO.S GIVEN BY THE USER #include #include #include struct complex     {     int real;     int imag;     }; void main()  {  clrs

What does extern mean in a function declaration in c++, It tells the compil...

It tells the compiler that a variable or a function exists, even if the compiler hasn't yet seen it in the file presently being compiled. This variable or function may be distinct

Cange to palindrome, A palindrome is a string that reads the same from the ...

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

C program for function of average, C program for function  of average ...

C program for function  of average int average(int); void main() {           int max=0,c=0;           clrscr();           printf("ENTER THE LIMIT OF INPUT FOR AV

Link list, For this program you will add and test 2 new member functions to...

For this program you will add and test 2 new member functions to the IntSLList class posted on the website. The two member functions are: insertByPosn(int el, int pos) Assuming t

Define external storage class - computer programming, Define External Stora...

Define External Storage Class - computer programming? When a variable is declared outside a function the storage is permanently assigned to it and its storage class is 'extern'

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd