Hello again
this is my second entry to post to this blog
today i will show you what is syntax (Parts, Definition, And How-To)
Parts
In basic syntax there 4 type all the syntax there are many different and purpose, the list of syntax which is :
- - Decision
- - Loops
- - Array
- - Function
1. Decision
- Decision is to make program the specifies one thing and another thing based on conditions, using the true or false. There are 3 type in decision which is:
- if
- if... else
- switch case
1- Decision ( if )
(INPUT)
(OUTPUT)
2- if.... else
(INPUT)
What the difference between if and if else, if based on true condition while the if... else there are false condition that can specifies which number that can put in group using else if and else statement
3- Switch Case
(INPUT)
(OUTPUT)
if you did not put (break;) after case to other case the result is print as first case and the next case like the picture below :
Switch case is a switch statement allows a variable to be tested for equality against a list of values.
2. Loops
loop is the statement to execute for multiple times first, second, an so on. Loop is divided become 3 types which is :- while
- do while
- for
1- while
(INPUT)
(OUTPUT)
2- do while
(INPUT)
(OUTPUT)
difference between while and do while is while must be check and repeat it until reach the end of the loop, do while must execute first before the number is check and repeat it until the end of the loop.
3- for
(INPUT)
(OUTPUT)
for is loop execute using the absolute number.
3.Array
Arrays a kind of data structure that can store a fixed-size sequential collection of elements of the same type. there are 2 types which is :
- Array
- Multi-Dimensional Array
1- Array
(INPUT)
(OUTPUT)
2- Multi-Dimensional Array
(INPUT)
(OUTPUT)
As you can see they start from Row 0 and Column 0. example if index is A [3][2] it mean that the number is (6)
4. Function
Function is a function is a group of statements that together perform a task..1-Function
(INPUT)
(OUTPUT)
(+)
(-)
(*)
(/)
Now you Know about the syntax from Decision, Loop, Array, and Function
That all from me
See you Next Time



