fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. double d_value;
  5. float f_value = 5.16;
  6. int n;
  7. d_value = f_value;
  8. d_value = d_value+0.5;
  9. n = (int)d_value;
  10. printf("%5.2f,%d",d_value,n);
  11. // your code goes here
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
 5.66,5