Advertisement
adventuretimeh

la media dei voti

Oct 10th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. /* run this program using the console pauser or add your own getch, system("pause") or input loop */
  5.  
  6. int main(int argc, char *argv[]) {
  7.     int a,b,c,somma;
  8.     float media;
  9.     printf("\n dammi il primo valore del numero ");
  10.     scanf("%d",&a);
  11.     printf("\n dammi il secondo valore del numero ");
  12.     scanf("%d",&b);
  13.     printf("\n dammi il terzo valore del numero ");
  14.     scanf("%d",&c);
  15.     somma=(a+b+c);
  16.     media=somma/3;
  17.     printf ("\n la media di %d+%d+%d/3 vale %6.2f\n",a,b,c,media);
  18.     system ("pause");
  19.    
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement