SHARE
TWEET

selezione due viee

adventuretimeh Dec 9th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. // se metti un numero con il meno esce sia la meta e il triplo//
  6.  
  7. int main(int argc, char *argv[]) {
  8. int num,doppio,triplo;
  9. float meta;
  10. printf("\ndammi un numero");
  11. scanf("%d",&num);
  12. if(num>0)
  13. {
  14. printf("\nnumero %d",num);
  15. doppio = num*2;
  16. printf("\n doppio %d",doppio);
  17. }
  18. else
  19.  
  20. {
  21. meta=(float)num/2;
  22. printf ("la meta del num vale %f",meta);
  23. }
  24. triplo=num*3;
  25. printf("\n triplo vale %d",triplo);
  26.  
  27.     return 0;
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top