Dicision Making : if statement Part 1
if statement
Look at the word :
“if it is not raining, we will go to school”
Here second part is depended to the first part because if not rain then we will go to school but if rain we can’t go to school. So we are making decision what we do which depend on the first statement. It is similar case in C program. We need to apply condition on our program and then the condition is true then the statement will be execute.
As like,
if(x>10) { printf(“x is greater”); } |
Here the condition is the value of x is greater then 10. If this condition is true then the printf statement will be execute. In this process, we make various type logical, relational or mathematical condition or decision in our program.
Written by “Shojib”
No comments:
Post a Comment