Java program to calculate standard deviation. A standard deviation is a statistic that measures a dataset’s dispersion from its mean. By calculating each data point’s divergence from the mean, the standard deviation is calculated as the square root of variance.

public class Main

{

public static void main(String[] args)

{

double[] numArray = { 1, 4,5,6,7,5,8,9, 10 };

double SD = calculateSD(numArray);

System.out.format("SD value is = %.6f", SD);

}

public static double calculateSD(double numArray[])

{

double sum = 0.0, standardDeviation = 0.0;

int length = numArray.length;

for(double num : numArray)

{

sum += num;

}

double mean = sum/length;

for(double num: numArray)

{

standardDeviation += Math.pow(num - mean, 2);

}

return Math.sqrt(standardDeviation/length);

}

}

Output:

SD value is = 2.601044

## What is standard deviation in java program

A data set’s standard deviation is a measure of how spread out it is. It can be found in a wide range of applications. Standard deviations of price data are commonly used as a measure of volatility in finance. Standard deviations are an important aspect of estimating margins of error in opinion polling.

A standard deviation is a statistic that measures a dataset’s dispersion from its mean. There is a bigger variance within the data set if the data points are further from the mean; consequently, the more spread out the data, the higher the standard deviation.

## What is double data type in java program

A primitive data type in Java is the double keyword. It’s a 64-bit IEEE 754 floating point with double precision. It’s where variables and methods are declared. It is used to represent decimal numbers in general.

Double is more exact than float and can store 64 bits, which is twice as much as float. We favour double over float for storing huge numbers because it is more exact.

## What is math.pow in java

The Math. pow() function converts the base to the exponent power, where the base and exponent are both in the decimal system. java.lang is a programming language that was developed by Sun Microsystems.

A number is raised to the power of another integer using the math. pow() function. This function takes two arguments and returns the first parameter’s value multiplied by the second. The value of the first parameter raised to the power of the second argument is returned by pow(). The pow() method returns a double value.

### Similar Programs

Write a c program to print hello world

C program to addition of two numbers

Write a program to check whether the given number is even or odd in c

C program to calculate the sum of odd and even numbers

C program to print calculator using switch statement

C program to print vowels or consonants using if-else

C program to print whether a year is leap or not

C program to print sum of digits using for loop

C program to find the factorial of a number using for loop

C program to print the swapping of two numbers using the third variable

Write a c program to print Fibonacci series using for loop

C program to print the Armstrong number for three digits of a given

Write a program to convert Fahrenheit into Celsius in c

Write a program to calculate the area of rectangle in c

Write a program to print the area of square in c

Write a c program to print multiplication table of any number using for loop

Write a c program to print the lcm of two numbers