-
Notifications
You must be signed in to change notification settings - Fork 0
/
Mat.c
59 lines (39 loc) · 1.4 KB
/
Mat.c
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
56
57
58
59
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
int main () {
setlocale(LC_ALL, ""); //Indentificar o Idioma
// Declarando Variáveis
char nome[200];
int idade;
float notaUm, notaDois, notaTres, notaQuatro, media, resultado;
// Solicitando dados para o Usuário
printf("\nDigite seu Nome: ");
scanf("%s", &nome);
fflush(stdin);
printf("\nDigite sua Matricula: ");
scanf("%i", &idade);
printf("\nDigite o 1 Numero: ");
scanf("%f", ¬aUm);
printf("\nDigite o 2 Numero: ");
scanf("%f", ¬aDois);
printf("\nDigite o 3 Numero: ");
scanf("%f", ¬aTres);
printf("\nDigite o 4 Numero: ");
scanf("%f", ¬aQuatro);
// Fazendo o Calculo
resultado = notaUm + notaDois + notaTres + notaQuatro;
media = (notaUm + notaDois + notaTres + notaQuatro) /4;
// Exibindo Resultados.
printf("\n=== Exibindo resultados ===\n");
printf("Nome: %s \n", nome);
printf("Primeira Unidade: %.2f \n", notaUm);
printf("Segunda Unidade: %.2f \n", notaDois);
printf("Terceira Unidade: %.2f \n", notaTres);
printf("Quarta Unidade: %.2f \n", notaQuatro);
printf ("Notas Das Unidades: %.1f \n", resultado);
printf ("Media: %.2f \n", media);
if (media > 7 (and resultado > 24) ) printf("\n Aluno foi Aprovado!!");
if (media < 6 and resultado < 23)printf ("\n Aluno foi Reprovado!!");
return 0;
}