fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int i, count=0, sum=0;
  6. double average;
  7. int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  8. for(i=0; i<10; i++)
  9. {
  10. if(a[i]%2 == 0)
  11. continue;
  12. sum+=a[i];
  13. count++;
  14. }
  15. average = sum/count;
  16. count<<"count = "<<count <<"\t;\t" << "average = " << average << end;
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:16:10: error: invalid operands of types ‘int’ and ‘const char [9]’ to binary ‘operator<<’
     count<<"count = "<<count <<"\t;\t" << "average = " << average << end;
     ~~~~~^~~~~~~~~~~~
stdout
Standard output is empty