Problem divideby2
User NoynYT
Submission Time 2025-02-19 22:31:02
Score 0
Max Time N/A
Max Memory N/A

Compile Error

divideby2.cpp: In function ‘int main()’:
divideby2.cpp:11:19: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
11 | cout<<n/2<<" "<<n%2<<"\n";
| ~^~
| | |
| | int
| double
divideby2.cpp:12:7: error: invalid operands of types ‘double’ and ‘int’ to binary ‘operator%’
12 | if (n%2==1){cout<<(n/2)+.5<<"\n"; return 0;}
| ~^~
| | |
| | int
| double