GeekInterview.com
Series: Subject: Topic:
Question: 9 of 51

Compute Average of Two Scores

Describe an algorithm to compute the average of two scores obtained by each of the 100 students
Asked by: The_Kerr1431 | Member Since Jun-2010 | Asked on: Jun 25th, 2010

View all questions by The_Kerr1431

Showing Answers 1 - 1 of 1 Answers
Sandhya.Kishan

Answered On : Apr 18th, 2012

View all answers by Sandhya.Kishan

This can be done using structures

struct student
{
int score1;
int score2;
}st[5];

int sum,avg;
printf("Enter the first score:");
scanf{"%d",&st[i].score1);
printf("Enter the second score:");
scanf{"%d",&st[i].score2);
for(i=0;i<5;i++)
{
sum=st[i].score1+st[i].score2;
avg=sum/2;
printf("average=%d",&avg);
}

  
Login to rate this answer.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.