Advertisement
adventuretimeh

divisione

Sep 30th, 2019
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 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;
  8.      float risultato;
  9.      printf("\n dammi il primo valore della divisione");
  10.      scanf("%d",&a);
  11.      printf("\n dammi il secondo valore della divisione");
  12.      scanf("%d",&b);
  13.      if(b!=0)
  14.         {
  15.         risultato = (float)a / b;
  16.         printf("\n la divisione di %d / %d vale %f",a,b,risultato);
  17.         }
  18.     else
  19.         printf("\n la divisione di %d / %d non puo' essere effettuata \n",a,b);
  20.  
  21.     system("pause");
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement