Created
May 17, 2016 06:42
-
-
Save AdrianGimenez/57e36457530913546ee7bd4db1da4307 to your computer and use it in GitHub Desktop.
Exam
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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",¬a1); | |
printf("Introdueix la segona nota\n"); | |
scanf("%f",¬a2); | |
printf("Introdueix la tercera nota\n"); | |
scanf("%f",¬a3); | |
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