Problem divideby2
User DaPeter
Submission Time 2025-12-26 13:44:09
Score 0
Max Time N/A
Max Memory N/A

Compile Error

divideby2.cpp: In function ‘int main()’:
divideby2.cpp:14:17: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
14 | cout<<((n-(n%2))/2)<<' '<<n%2<<ndl;
| ~^~
| | |
| | int
| double
divideby2.cpp:14:32: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
14 | cout<<((n-(n%2))/2)<<' '<<n%2<<ndl;
| ~^~
| | |
| | int
| double
divideby2.cpp:14:36: error: ‘ndl’ was not declared in this scope; did you mean ‘endl’?
14 | cout<<((n-(n%2))/2)<<' '<<n%2<<ndl;
| ^~~
| endl