Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <stdio.h>
  2. float atlag(int m)
  3. {
  4. int i =1; float szam , osszeg =0;
  5. while (i<=m)
  6. { printf ("%d. szam: " , i ++);
  7. scanf ("%f" , &szam );
  8. osszeg+=szam; }
  9. return osszeg /m;
  10. }
  11.  
  12. main(){
  13. int n;
  14. printf("Mennyi szam kell neked? \n");
  15. scanf("%d\n", &n);
  16.  
  17. printf("Az atlaguk: %1.2f\n", atlag
  18. (n));
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement