Advertisement
Guest User

1118

a guest
Feb 20th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. double a,n,count=0,sum=0;
  5. int i;
  6. while(1)
  7. {
  8. scanf("%lf",&n);
  9.  
  10.  
  11. if(n>=0 && n<=10)
  12. {
  13. count++;
  14. sum=sum+n;
  15. }
  16. else
  17. {
  18. printf("nota invalida\n");
  19. }
  20. if(count==2)
  21. break;
  22.  
  23. }
  24. printf("media = %0.2lf",sum/2.00);
  25.  
  26. while(1)
  27. {
  28.  
  29.  
  30. scanf("%d",&a);
  31. printf("novo calculo (1-sim 2-nao)\n");
  32. if(a==1 || a==2)
  33. break;
  34.  
  35. if(a==1)
  36. continue;
  37. else if(a==2)
  38. break;
  39.  
  40. }
  41.  
  42. return 0;
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement