I fixed that now how can I fix this problems. counter.cpp:34: error: expected unqualified-id before '{' token
counter.cpp:34: error: expected `,' or `;' before '{' token
counter.cpp: In function `int odd_one_to_n(int)':
counter.cpp:43: error: expected primary-expression before "int"
counter.cpp:43: error: expected `;' before "int"
counter.cpp:44: error: `k' undeclared (first use this function)
counter.cpp:44: error: (Each undeclared identifier is reported only once for each function it appears in.)
counter.cpp:44: error: expected `;' before ')' token
counter.cpp: In function `int square_cube(int)':
counter.cpp:81: error: no match for 'operator<' in '(+std::operator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(&std::cout)), ((const char*)" Cube of n = ")))->std::basic_ostream<_CharT, _Traits>::operator<< [with _CharT = char, _Traits = std::char_traits<char>](cube) < std::endl'
counter.cpp: At global scope:
counter.cpp:86: error: expected unqualified-id before '{' token
counter.cpp:86: error: expected `,' or `;' before '{' token
It sounds like someone is trying to avoid reading his c++ book and is simply copy/pasting code that they do not understand.
There is no replacement for reading your book... so do it.
Study what each of the lines of the code does... Learn how c++ code is supposed to be structured. The basic compiler errors should be very easy to decipher for anyone that did their homework.
If it was something a bit more complex, like a dynamic array or pointers... I would understand... but this is ridiculous