Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AdrianGimenez/57e36457530913546ee7bd4db1da4307 to your computer and use it in GitHub Desktop.
Save AdrianGimenez/57e36457530913546ee7bd4db1da4307 to your computer and use it in GitHub Desktop.
Exam
#include <stdlib.h> //librería estándar (me permite utilizar el random)
#include <stdio.h> //librería estándar entrada / salida (printf y scanf)
void main () {
float nota1,nota2,nota3=0;
float mitjana=0;
char continuar = 's';
while (continuar == 's'){
system ("clear");
printf("Introdueix la primera nota\n");
scanf("%f",&nota1);
printf("Introdueix la segona nota\n");
scanf("%f",&nota2);
printf("Introdueix la tercera nota\n");
scanf("%f",&nota3);
mitjana = (nota1 + nota2 + nota3)/3;
printf ("La teva nota mitjana és: %.2f \n",mitjana);
getchar();
printf("Vols continuar?\n");
scanf("%c",&continuar);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment