Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4.  
  5.    
  6. {
  7.     int nota=0,media,x=0,y=0;
  8.     printf("Qual nota ?");
  9.     scanf("%d", &nota);
  10.     while(nota < 10 && nota > 0)
  11.     {
  12.         x=x+nota;
  13.         y=y+1;
  14.         scanf("%d",&nota);
  15.        
  16.     }
  17.    
  18.     media=x/y;
  19.     printf("media: %d", media);
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement