0
Can anyone help me with curly brackets and semi colans ? I just fail to write a program because i dont know where to insert them
please help me out.
2 Respostas
+ 6
You haven't mentioned the language. Some programming languages like Python, Ruby etc. do not need semicolons or braces.
In general, semicolon should be inserted when a statement is ended.
int a = 5;
Curly braces indicate a block/body. For example, a block for if-else, loop, function etc.
if(a==5){
printf("Five");
b = a;
}
For the above code, curly braces are creating a block which consists of two statements. Both the statements will execute if a is 5.
+ 2
; after the end of a statement & curly braces after writing paramaters for functions or while using loops or condition statement.