Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- float Summe = 0;
- int Anzahl = 0;
- float Note;
- float Durchschnitt;
- scanf("%f",&Note);
- while(Note != 0)
- {
- if(Note > 0 && Note <=6)
- {
- Summe = Summe + Note;
- Anzahl++;
- }
- else
- {
- printf("Nur Ziffern von 1-6!");
- }
- scanf("%f",&Note);
- }
- if(Anzahl >= 2)
- {
- Durchschnitt = Summe / Anzahl;
- printf("%.2f",Durchschnitt);
- }
- else
- {
- printf("Zu wenige Noteneingaben");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement