package rsrajkumar;
import java.util.Scanner;
public class myclass
{
public static void main(String[] args)
{
int[] myarray = new int[100];
int n;
float sum=0,mean=0,sub=0,tot=0,sd=0;
Scanner my= new Scanner(System.in);
System.out.println("Enter Total no.of element");
n = my.nextInt();
System.out.println("Enter "+n+" Numbers");
for(int i=0;i<n;i++)
{
myarray[i] = my.nextInt();
sum=sum+myarray[i];
}
mean=sum/n;
System.out.println("Mean value is "+mean);
for(int i=0;i<n;i++)
{
sub=(myarray[i]-mean);
sub=sub*sub;
tot=tot+sub;
}
sd=tot/(n-1);
double sq = Math.sqrt(sd);
System.out.println("Standard Devation value is "+sq);
}
}
By
Rajkumar Rajarathnam Subramanian
<http://www.rsrajkumar.blogspot.com>*
No comments:
Post a Comment