Question about Microsoft Computers & Internet

Ad

Hi,
here is the program
#include<stdio.h>
#include<conio.h>
void main()
{
int class[30],i;
float sum=0,avg=0;
printf("enter marks");
for(i-0;i<30;i++)
scanf("%d",&class[i]);
for(i-0;i<30;i++)

sum+=class[i];
avg=sum/30;
printf("%f",avg);
getch();
}

Posted on May 08, 2009

Ad

Hi there,

Save hours of searching online or wasting money on unnecessary repairs by talking to a 6YA Expert who can help you resolve this issue over the phone in a minute or two.

Best thing about this new service is that you are never placed on hold and get to talk to real repairmen in the US.

Here's a link to this great service

Good luck!

Posted on Jan 02, 2017

Ad

That appears to be an intermediate question in a programming class. Best read the book, the answer is not what is important the process of getting the answer is what you are trying to learn.

May 17, 2017 | Office Equipment & Supplies

Midpoints ( x + y)/2 = x47.567.57988.597

Boundaries for lower class -0.5 and +.0.5 for upper.39.5 - 55.559.5 - 75.575.5 - 82.582.5 - 94.594.5 - 99.5

I just don't get how the number of students factor in? It's still an average.

Boundaries for lower class -0.5 and +.0.5 for upper.39.5 - 55.559.5 - 75.575.5 - 82.582.5 - 94.594.5 - 99.5

I just don't get how the number of students factor in? It's still an average.

Oct 11, 2012 | Computers & Internet

create a flowchart that will compute a grade of a certain student.

Aug 15, 2010 | Patton & Patton Flow Charting 5 (29000U)

Everything can be in the one file if you want, but that doesn't help with segregation of logic from the presentation layer (i.e. what you see on screen).

Personally I'd put my core class libraries in one or more files and include() them. And I'd probably put any extended classes in separate files and include() them additionally.

include ('library.class.php');

include ('extended.class.php');

Personally I'd put my core class libraries in one or more files and include() them. And I'd probably put any extended classes in separate files and include() them additionally.

include ('library.class.php');

include ('extended.class.php');

Oct 14, 2009 | Computers & Internet

NEED A NEW KEY THE ONE ON THE BOX WONT WORK

Jul 29, 2009 | Microsoft Windows XP Professional With...

the best thing to do here is to separate the steps for calculating the variance into different functions. To compute the variance the first thing to do is to compute the mean or the average of the numbers in the array. so your first function will loop through each of the numbers and divide it by the length of your array. the output is the returned. The next thing to do is create another function for the variance. loop through each of the numbers again and subtract to each number the mean. square the value then add to the previous. so that means you have another variable that starts from zero and just adds the answer. after that divide it by the length of the array again and what you are going to get is the value for the variance.

May 13, 2009 | Computers & Internet

Hi,

I am writing in C code here

#include<stdio.h>

#include<conio.h>

void main()

{

int a[5],i,sum=0;

float avg=0;

printf("enter the five values");

for(i=0;i<5;i++)

scanf("%d",&a[i]);

for(i=0;i<5;i++)

sum+=a[i];

printf("Sum=%d",sum);

avg=sum/5;

printf("Average=%f",avg);

getch();

}

I am writing in C code here

#include<stdio.h>

#include<conio.h>

void main()

{

int a[5],i,sum=0;

float avg=0;

printf("enter the five values");

for(i=0;i<5;i++)

scanf("%d",&a[i]);

for(i=0;i<5;i++)

sum+=a[i];

printf("Sum=%d",sum);

avg=sum/5;

printf("Average=%f",avg);

getch();

}

Mar 18, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

for int i=0; i< array.count; i++

{

sum+= array[i];

}

average = sum/5

{

sum+= array[i];

}

average = sum/5

Mar 11, 2009 | ArcMedia JavaScript Source Code 3000 Pro...

Do you need them to be sorted after the merge and are they already sorted? If not, then what you can do is create a temporary third array which will set the half of third array equal to the first array, and then set the set half equal to the second array. If they need to be sorted, I can help too but you need to tell me

public class ArrayMerge

{

public static int arr1[] = new int [20];

public static int arr2[] = new int [20];

public static void main()

{

setScores(arr1);

setScores(arr2);

printScores(arr1);

printScores(arr2);

printScores(merger(arr1,arr2));

}

public static void setScores(int a[])

{

for(int x = 0; x<a.length; x++)

{

a[x]= (int)(Math.random() * 100)+1;

}

}

public static void printScores(int a[])

{

for(int x = 0; x<a.length; x++)

{

System.out.print(a[x] + " ");

}

System.out.println();

}

public static int[] merger(int a1[], int a2[])

{

int a3[] = new int [(a1.length + a2.length)];

for(int x = 0; x<a1.length; x++)

{

a3[x]=a1[x];

}

for(int x = 0; x<a2.length; x++)

{

a3[x+a2.length]=a2[x];

}

return a3;

}

}

public class ArrayMerge

{

public static int arr1[] = new int [20];

public static int arr2[] = new int [20];

public static void main()

{

setScores(arr1);

setScores(arr2);

printScores(arr1);

printScores(arr2);

printScores(merger(arr1,arr2));

}

public static void setScores(int a[])

{

for(int x = 0; x<a.length; x++)

{

a[x]= (int)(Math.random() * 100)+1;

}

}

public static void printScores(int a[])

{

for(int x = 0; x<a.length; x++)

{

System.out.print(a[x] + " ");

}

System.out.println();

}

public static int[] merger(int a1[], int a2[])

{

int a3[] = new int [(a1.length + a2.length)];

for(int x = 0; x<a1.length; x++)

{

a3[x]=a1[x];

}

for(int x = 0; x<a2.length; x++)

{

a3[x+a2.length]=a2[x];

}

return a3;

}

}

Jan 24, 2009 | Microsoft Windows XP Professional With...

Hi Griffnz,

Your "known Y's" or 'values' are in Column B. This is the first array in the Trend formula.

Your "known X's" or 'months' are in Column A. This is the second array in the trend formula.

The trend formula is supposed to give you a projection of what the rest of the values in Column B will be over the next few months (usually continuing cells in Column A). The cells you want these values to show up in represent the third array in the formula.

Thus, your formula should look more like: '=trend(B3:B14,A3:A14,A15:A18)'

However, your formula is leaving out The values in B and adding values from C - -- but there ARE no values in C. Apparently, C is where you want the values to appear. In that case, the C array would be the third array in your formula. This would look more like '=trend(B3:B14,A3:A14,C3:C14)

If this doesn't make sense, let me know.

Your "known Y's" or 'values' are in Column B. This is the first array in the Trend formula.

Your "known X's" or 'months' are in Column A. This is the second array in the trend formula.

The trend formula is supposed to give you a projection of what the rest of the values in Column B will be over the next few months (usually continuing cells in Column A). The cells you want these values to show up in represent the third array in the formula.

Thus, your formula should look more like: '=trend(B3:B14,A3:A14,A15:A18)'

However, your formula is leaving out The values in B and adding values from C - -- but there ARE no values in C. Apparently, C is where you want the values to appear. In that case, the C array would be the third array in your formula. This would look more like '=trend(B3:B14,A3:A14,C3:C14)

If this doesn't make sense, let me know.

Sep 30, 2008 | Microsoft Excel for PC

117 people viewed this question

Usually answered in minutes!

×