Advertisement
dilella

Untitled

Sep 27th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2. int main ()
  3. {
  4. double i,f, incr,d,F;
  5. printf ( "Valor inicial: ");
  6. scanf ("%lf", &i);
  7. printf ("Valor final: ");
  8. scanf("%lf",&f);
  9. printf("Incremento: ");
  10. scanf("%lf", &incr);
  11. d=i;
  12.  
  13. if (-100>i || i>100) {
  14.  
  15. printf ("Valores invalidos.") ;
  16. }
  17.  
  18. else if ( -100>f || f>100){
  19. printf("Valores invalidos.");
  20. }
  21.  
  22. else if (incr <0.1) {
  23. printf("Valores invalidos.");
  24.  
  25. }
  26. else if (i>f){
  27. printf ("Valores invalidos.");
  28. }
  29.  
  30. else {
  31.  
  32. while (d <= f ){
  33. F= ((d*1.8)+32);
  34. printf ("%7.2lf --> %7.2lf\n",d,F);
  35.  
  36. d= d+incr;
  37.  
  38. }
  39.  
  40.  
  41.  
  42. }
  43.  
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement