Skip to content

Algoritmo em C #49442

Discussion options

You must be logged in to vote

#include <stdio.h>

int main() {
float nota1, nota2, nota3, nota4, media;

// Pede as notas bimestrais
printf("Digite a primeira nota bimestral: ");
scanf("%f", &nota1);

printf("Digite a segunda nota bimestral: ");
scanf("%f", &nota2);

printf("Digite a terceira nota bimestral: ");
scanf("%f", &nota3);

printf("Digite a quarta nota bimestral: ");
scanf("%f", &nota4);

// Calcula a média
media = (nota1 + nota2 + nota3 + nota4) / 4.0;

// Mostra a média com uma casa decimal
printf("A média bimestral é: %.1f\n", media);

return 0;
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mario-baianor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codespaces Your development environment, in the cloud. Run VS Code and code on GitHub's cloud platform, Question
2 participants