fork download
  1. #include <iostream>
  2. #include <boost/>
  3.  
  4. using namespace std;
  5.  
  6. int gcd(int a,int b){
  7. if(a == 0) return b;
  8. else return gcd(b%a,a);
  9. }
  10. void decimalToFrac(float input){
  11. int numerator, denominator;
  12. string stringInput = atoi(input);
  13. char *tokens = strtok(stringInput,",");
  14. if(tokens.length() != 0){
  15. numerator = tokens[0];
  16. denominator = tokens[1];
  17. }
  18. int gcd = gcd(numerator,denominator);
  19. cout << "\n Fraction in lowest form : " << numerator/gcd << "/" << denominator/gcd << endl;
  20.  
  21. }
  22. int main(void)
  23. {
  24. decimalToFrac(1.2);
  25. return 0;
  26. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:18: fatal error: boost/: No such file or directory
 #include <boost/>
                  ^
compilation terminated.
stdout
Standard output is empty