Advertisement
Guest User

תכנית חישוב ממוצע עם לולאות

a guest
Oct 31st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. void main ()
  5. {
  6. float a,b,c,d,e,sum;
  7. int x,y //for string
  8. printf ("Enter 5 grades /n");
  9. scanf ("%f %f %f %f %f",&a,&b,&c,&d,&e);
  10. sum = (a+b+c+d+e)/5
  11. if (sum>55)
  12. {
  13. for (x=1;x<=10;x++)
  14. printf ("Well done");
  15. }
  16. else
  17. {
  18. for (y=1;y<=5;y++)
  19. printf ("Fail");
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement