-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy path1118.c
More file actions
55 lines (35 loc) · 616 Bytes
/
1118.c
File metadata and controls
55 lines (35 loc) · 616 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <stdio.h>
int media();
int main () {
media();
}
int media () {
int opcao = 0, cont = 0;
float nota, resultado;
resultado = 0;
while (cont != 2)
{
scanf("%f", ¬a);
if (nota < 0 || nota > 10)
{
printf("nota invalida\n");
}
else
{
resultado += nota;
cont++;
}
}
cont = 0;
printf("media = %.2f\n", resultado/2);
opcao = 0;
do
{
printf("novo calculo (1-sim 2-nao)\n");
scanf("%d", &opcao);
if (opcao == 1)
{
media();
}
} while ((opcao != 1) && (opcao != 2));
}