Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6654559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:24:16+00:00 2026-05-26T01:24:16+00:00

I have this code to find the mean and standard deviation of some input

  • 0

I have this code to find the mean and standard deviation of some input values. But it’s a static program. I want to pull this through a MySQL database and use it. Can you help me out?

int main[]
[
/* 2-dimensional array is used to store the height,lenght and the width attributes of the nose. indian
array represents
the indian data and the china array represents the chinese data */
/* Mean variable represents the mean values. The subscripts are used to identify indian and chinese
attributes */
float indian[MAX][3],china[MAX]
[3],mean_ih=0,mean_il=0,mean_iw=0,mean_ch=0,mean_cl=0,mean_cw=0;
/* Following float variables store the standard deviation values */
float sd_ih=0,sd_il=0,sd_iw=0,sd_ch=0,sd_cl=0,sd_cw=0;
int i,j;
float test_h,test_l,test_w;

/* POPULATING THE INDIAN DATABASE */

indian[i][j]=random[]/DIV;

/POPULATING THE CHINESE DATABASE/

china[i][j]=random[]/DIS;

Finding the MEAN of the Indian and the Chinese Data

mean_ih+=indian[i][0];
mean_il+=indian[i][1];
mean_iw+=indian[i][2];
mean_ch+=china[i][0];
mean_cl+=china[i][1];
mean_cw+=china[i][2];
mean_ih=mean_ih/MAX; mean_il=mean_il/MAX; mean_iw=mean_iw/MAX;
mean_ch=mean_ch/MAX; mean_cl=mean_cl/MAX; mean_cw=mean_cw/MAX;

To find the Standard Deviation of the entries

sd_ih+=pow[[indian[i][0]-mean_ih],2];
sd_il+=pow[[indian[i][1]-mean_il],2];
sd_iw+=pow[[indian[i][2]-mean_iw],2];
sd_ch+=pow[[china[i][0]-mean_ch],2];
sd_cl+=pow[[china[i][1]-mean_cl],2];
sd_cw+=pow[[china[i][2]-mean_cw],2];

sd_ih=sqrt[sd_ih/MAX]; sd_il=sqrt[sd_il/MAX]; sd_iw=sqrt[sd_iw/MAX];
sd_ch=sqrt[sd_ch/MAX]; sd_cl=sqrt[sd_cl/MAX]; sd_cw=sqrt[sd_cw/MAX];

Prompting the user to enter data to verify

printf [” \n ============================================================\n”];
printf[” \n Enter the Height \n”];
scanf[” %f”,&test_h];
printf [” \n ============================================================\n”];
printf[” \n Enter the length \n”];
scanf[“%f”,&test_l];
printf [” \n ============================================================\n”];
printf[” \n Enter the width \n “];
scanf [“%f”,&test_w];
printf [” \n ============================================================\n”];
if [[abs[mean_ih-test_h]

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:24:16+00:00Added an answer on May 26, 2026 at 1:24 am

    You will need to look at the mySQL C API documentation here for how to connect to a MySQL database through a C program.

    For a tutorial, you can also take a look at this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code, but i cant make it work: images = Image.find_by_sql('PREPARE stmt
I have this block of code: users = Array.new users << User.find(:all, :conditions =>
I have borrowed code from this link PHP regex templating - find all occurrences
If I have a block of code like this: def show @post = Post.find(params[:id])
I have been unable to find any decent documentation on this function. The code
I have this code in jQuery, that I want to reimplement with the prototype
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
Is there a way to validate this code I have below? I mean I
I have some troubles to find the right loop to check if some values
I have code like this, and I find it a bit hard to read:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.