Week 2: Things actually make sense.

for (int = 1; i < 3; i++);
  • Listing the three students/scores
  • Assigning it’s number to the score
  • Adding them all up and dividing by 3.
#include <stdio.h>int main (void);
{
int scores[3]; scores[0] = 73;
scores[1] = 44;
scores[2] = 33;
printf("Average score: %f\n", score0 + score 1 + score2 / 3);
}
int main (void)

int scores[3];
scores[0] = get_int("Score: ");
scores[1] = get_int("Score: ");
scores[2] = get_int("Score: ");
printf("Average score: %f\n", score0 + score 1 + score2) / 3;}
int main (void)
{
int n = get_int("How many scores?: ");
int score[n];
for (int = i; i < n; i++)
{
scores[n] = get_int("Score: ");
}
printf("Average Score: %f\n", (score1 + score2 + score3) / 3.0)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
mic.exe

mic.exe

My path to a passion-driven life with code.