Guest User

Untitled

a guest
May 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4. int main(int argc, char *argv[])
  5.  
  6. {
  7. int a[10],i,sum,r;
  8. sum=0;
  9.  
  10. float mor;
  11. mor=0;
  12. srand ( time(0) );
  13. for (i=1;i<=10;i++)
  14. {
  15. r = rand() % 100;
  16. a[i]=r;
  17. printf("%d\n",a[i]);
  18. sum=sum+a[i];
  19. }
  20. printf("to athroisma einai %d\n",sum);
  21. mor=sum/10,000;
  22. printf("o mesos oros einai %f\n",mor);
  23. system("PAUSE");
  24. return 0;
  25.  
  26. }
Add Comment
Please, Sign In to add comment