Lisaveta777

Prata chapter 5 exc 9

Aug 4th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. //short version
  4. //suppose to scan into float and print it, till instead of float will be entered 'q'
  5. //MISTAKE it goes in endless cycle instead, once 'q ' is entered
  6. //longer version with possibility to see, how it works is here
  7. // https://pastebin.com/JVL3MyYp
  8.  
  9. int main()
  10.  
  11. {
  12.     float f;
  13.    
  14.     scanf("%f",&f);
  15.  
  16.     while( f!= (float)'q')
  17.     {
  18.         printf("f is %f\n",f);
  19.         scanf("%f",&f);
  20.  
  21.     }
  22.  
  23.     return 0;
  24. }
Add Comment
Please, Sign In to add comment