fork download
  1. #include <iostream>
  2. using namespace std;
  3. const int num = 6;
  4.  
  5. float convert (float temps [ ], int num);
  6. int main()
  7. {
  8. int i;
  9. float Fahrenheit[] = {-40.0, 0, 32.0, 98.6, 100.0, 212.0};
  10. float Celcius[6];
  11.  
  12. Celcius = convert(Fahrenheit, num);
  13.  
  14. for (i = 0; i < num; ++i)
  15. {cout << Celcius[i];}
  16. system("pause");
  17. return 0;
  18. }
  19.  
  20. float convert (float tempz[], int i)
  21. {
  22. float celcius[6];
  23. for( i = 0; i < 6; ++i)
  24. {celcius[i] = ( tempz[i] - 32) * (5/9);}
  25.  
  26. return celcius[6];
  27. }
  28.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:12: error: incompatible types in assignment of ‘float’ to ‘float [6]’
prog.cpp:16: error: ‘system’ was not declared in this scope
stdout

Standard output is empty