Code:
#include <stdio.h> int main(void)
{
char answer;
int team[6] = { "1", "2", "3", "4", "5", "6" };
int hometeam;
int awayteam;
int homescore;
int awayscore;
int pointhome;
int pointaway;
int played = 0;
int n;
do{
printf("\n\n");
printf("Home team number :");
scanf_s("%i", &hometeam);
printf("\n\n");
printf("Away team number :");
scanf_s("%i", &awayteam);
printf("\n\n");
printf("Home team score: ");
scanf_s("%i", &homescore);
printf("\n\n");
printf("Away team score: ");
scanf_s("%i", &awayscore);
if (homescore > awayscore )
pointhome = +3;
else if (homescore < awayscore)
pointhome = +0;
else if (homescore = awayscore)
pointhome = 1;
if (awayscore > homescore)
pointaway = +3;
else if (awayscore < homescore)
pointaway = +0;
else if (awayscore = homescore)
pointaway = 1;
printf("\n\n");
printf("Team\tGoals for\tGoals against\t\tPoints");
printf("\n\n");
if (hometeam == 1)
printf("Team 1\t\t%i\t\t%i\t\t%i",homescore, awayscore, pointhome);
else if (awayteam == 1)
printf("Team 1\t\t%i\t\t%i\t\t%i",awayscore, homescore, pointaway);
else printf("Team 1\t\t0\t\t0\t\t0");
printf("\n\n");
if (hometeam == 2)
printf("Team 2\t\t%i\t\t%i\t\t%i", homescore, awayscore, pointhome);
else if (awayteam == 2)
printf("Team 2\t\t%i\t\t%i\t\t%i", awayscore, homescore, pointaway);
else printf("Team 2\t\t0\t\t0\t\t0");
printf("\n\n");
if (hometeam == 3)
printf("Team 3\t\t%i\t\t%i\t\t%i", homescore, awayscore, pointhome);
else if (awayteam == 3)
printf("Team 3\t\t%i\t\t%i\t\t%i", awayscore, homescore, pointaway);
else printf("Team 3\t\t0\t\t0\t\t0");
printf("\n\n");
if (hometeam == 4)
printf("Team 4\t%i\t\t%i\t\t%i", homescore, awayscore, pointhome);
else if (awayteam == 4)
printf("Team 4\t%i\t\t%i\t\t%i", awayscore, homescore, pointaway);
else printf("Team 4\t\t0\t\t0\t\t0");
printf("\n\n");
if (hometeam == 5)
printf("Team 5\t\t%i\t\t%i\t\t%i", homescore, awayscore, pointhome);
else if (awayteam == 5)
printf("Team 5\t\t%i\t\t%i\t\t%i", awayscore, homescore, pointaway);
else printf("Team 5\t\t0\t\t0\t\t0");
printf("\n\n");
if (hometeam == 6)
printf("Team 6\t\t%i\t\t%i\t\t%i", homescore, awayscore, pointhome);
else if (awayteam == 6)
printf("Team 6\t\t%i\t\t%i\t\t%i", awayscore, homescore, pointaway);
else printf("Team 6\t\t0\t\t0\t\t0");
printf("\n\n");
printf("\nPress Y to continue. Press N To Exit : ");
scanf_s(" %c", &answer);
printf("\n\n");
} while (answer == 'y' || answer == 'Y');
}