All pastes #393206 Raw Edit

Mic

public text v1 · immutable
·published 2007-03-13 11:20 UTC
rendered paste body
void main(void)
{
	int gennemsnit;
	int lang;
	int valg;
	Grades();
	Push(&root, "Henry", 03);
	Push(&root, "Laust", 13);
	lang = Length(root);
	//printf("Length of the list is: %d \n\n", lang);
	//UdskrivListe(root);
	gennemsnit = GennemSnit(root);
	//printf("The average of the grades in the list is: %d\n", gennemsnit);

	
		while (1) {
			printf("Welcome the menusystem of the gradelist.\n");
			printf("Chose an action: \n");
			printf("1. Print the whole list\n");
			printf("2. Print the average of the grades\n");
			printf("6. Exit\n");

		valg = scanf("%d",&valg);
			if (valg == 1) {
				printf("****** You picked 1 ******\n");
				UdskrivListe(root);
			} else if (valg == 2) {
				printf("****** You picked 2 ****** \nThe average of the grades are: ");
				printf("%d\n", gennemsnit);

			} else if (valg == 6) {
				printf("****** You picked 5, exiting program ******");
				break;
			}
		}