Advertisement
Guest User

Untitled

a guest
Oct 20th, 2015
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include<stdio.h>
  2. int main(){
  3.     int cislo=0,pocet=0;
  4.     float sum=0,ap;
  5.     do{
  6.         printf("zadej cislo na vypocet aritmetickeho prumeru");
  7.         scanf("%d",&cislo);
  8.         if(cislo<10){
  9.             sum+=cislo;
  10.             pocet++;
  11.         }
  12.         else{
  13.             printf("\nzadavej pouze cisla mensi nez 10\n\n");
  14.         }
  15.     }
  16.     while(cislo!=5);
  17.     ap=sum/pocet;
  18.     printf("\naritmeticky prumer zadanych cisel je: %.2f",ap);
  19.     return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement