Syntax error problem occurring

source.cpp: In function β€˜int main()’:
source.cpp:4:1: error: a function-definition is not allowed here before β€˜{’ token
4 | {
| ^

Why do this error keeps coming even after checking syntax many times

Okay you need to define your functions outside of main()