Get Email Subscription

Enter your email address:

Delivered by FeedBurner

Sunday, April 4, 2010

To find and print the standard deviation.

Write a program in C to input 12 numbers and then calculate, print the standard deviation of these numbers.
H&R Block At Home 2009 Deluxe Federal + State + eFile [Formerly TaxCut] [Download]

#include<stdio.h>
#include<conio.h>
#include<math.h>
#define N 12

void main( )
{
float x, sx, sxx, sd, a;
sx = sxx = 0;
for (a=1; a<=N; a++)
{
printf("Enter value of x");
scanf("%f", &x);
sx = sx + x;
sxx = sxx + x * x;
}
sd = sqrt(sxx / N - (sx/N) * (sx/N));
printf("Standard Deviation is %.2f\n", sd);
}

Super Mario Galaxy 2
read more "To find and print the standard deviation."

To find and print Karl pearson's correlation coefficient.

Walk A Mile In My ShoesWrite a program in C to input 10 pairs of x and y values and then print Karl pearson's correlation coefficient.
It Didn't Make A Sound [+Video]
Need You Now
The Story So Far

#include<stdio.h>
#include<conio.h>
#include<math.h>
#define N 10

void main( )
{
int i;
float x, y, sx=0, sy=0, sxx=0, syy=0, sxy=0, a, b, c, r;
for(i=0; i
{
printf("Enter values for x & y");
scanf("%f %f", &x, &y);
sx = sx + x;
sy = sy + y;
sxx = sxx + x * x;
syy = syy + y * y;
sxy = sxy + x * y;
}
a = sxy-sx*sy/N;
b = sqrt(sxx-sx*sx/N);
c = sqrt(syy-sy*sy/N);
r = a / (b*c);
printf("Coefficient of correlation is %f\n", r);


}

read more "To find and print Karl pearson's correlation coefficient."

To find and print the regression coefficient.

The Twilight Saga: New Moon (Two-Disc Special Edition)
Write a program in C to input 25 pair of x & y and calculate and print the regression coefficient (b).


#include<stdio.h>
#include<conio.h>
#include<math.h>

#define N 25
void main( )
{
int i, x, y;
float sx=0, sy=0, sxy=0, syy=0, a, b, c;
clrscr( );
for(i=1; i<=N; i++)
{
printf("Input values of x & y pairwise\n");
scanf("%d %d", &x, &y);
sx = sx + x;
sy = sy + y;
sxy = sxy + x * y;
syy = syy + y * y;
}
a = N*sxy - sx*sy;
c = N*syy - sy*sy;
b = a/c;
printf("\n The regression coefficient is %f\n", b);
}
read more "To find and print the regression coefficient."

To find and print Correlation of coefficient.

The Blind SideWrite a program in C to input 5 integer values of x & y and to calculate and print the coefficient of correlation between x & y.



#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int x, y, i;

float sx=0, sy=0, sxx=0, syy=0, sxy=0, a, b, c, r;
clrscr( );
for(i=1; i<=5; i++)
{
printf("Input values of x and y pairwise\n");
scanf("%d %d", &x, &y);
sx = sx + x;
sy = sy + y;
sxx = sxx + x * x;
syy = syy + y * y;
}
a = sxy - (sx * sy) / 5;
b = sqrt(sxx - (sx * sx) / 5 );
c = sqrt(syy - (sy * sy) / 5 );
r = a / (b *c);
printf("The correlation coefficient = %f\n", r);

}
read more "To find and print Correlation of coefficient."

Saturday, April 3, 2010

To find and print mean and mean deviation.

The Big Short: Inside the Doomsday Machinewrite a program in C to input 15 observations and then find and print mean and mean deviation from mean where, mean = SX/15 and mean deviation from mean = S |X-mean| / 15.



#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int a, x[15];

float tot=0, mdt=0, d, m, md;
printf("Input 15 values of x, one at a time\n");
for(a=0; a<15; a++)
{
scanf("%d", &x[a]);
tot = tot+x[a];
}
m = tot / 15;
for(a=0; a<15; a++)
{
d = x[a] - m;
if (d < 0 )
d = -d;
mdt = mdt + d;

}
md = mdt / 15;
printf("\n Mean = %f\n", m);
printf("Mean deviation = %f\n", md);
}

The Big Short: Inside the Doomsday Machine
read more "To find and print mean and mean deviation."

To find and print mean

Kindle Wireless Reading Device (6" Display, Global Wireless, Latest Generation)Input 10 integers values of x and calculate and print its mean(m).

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int i, x[10];

float s1=0, m;
clrscr( );
printf("Input 10 values of x, one at a time\n");
for(i=1; i<=10; i++)
{
scanf("%d", &x[i]);
s1 = s1+x[i];
}
m = s1/10;
printf("\n The mean is %f\n", m);
}
Kindle Wireless Reading Device (6" Display, Global Wireless, Latest Generation)
read more "To find and print mean"

To find and print mean and standard deviation.

Write a program in C to input 5 integer values (x) and to find and print their mean (m) and standard deviation (sd).

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main( )
{
int i, x[5];
float s1=0, s2=0, d, m, sd;
clrscr( );
printf("Input 5 values of x, one at a time\n");
for(i=1; i<=5; i++)

{
scanf("%d", &x[i]); 
s1 = s1+x[i]; 

m = s1/5;
for(i=1; i<=5; i++)
{
d = s[i] - m;
s2 = s2+d*d;
}
sd = sqrt(s2/5);
printf("\n The mean is %f\n", m);
printf("The standard deviation is %f\n", sd);
}
read more "To find and print mean and standard deviation."

About This Blog

Lorem Ipsum

  © Blogger templates Newspaper III by Ourblogtemplates.com 2008

Back to TOP