Created
December 14, 2018 14:14
-
-
Save ivanelson/9c2ce1867ab4c96a34854765d895e553 to your computer and use it in GitHub Desktop.
For loop in "C"
This file contains hidden or 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 <stdio.h> | |
#include <stdlib.h> | |
void main() { | |
float nota, soma=0, media; | |
int conta; | |
for (conta = 0; conta <= 9; conta++) { | |
printf("Digite a nota: "); | |
scanf("%f", ¬a); | |
soma = soma + nota; | |
} // Esta chave encerra o laco "for" | |
printf("\nValor de conta: %d", conta); | |
media = soma / conta; | |
printf("\nA media da turma eh: %f ", media); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment