The operator is a combination ( ? ) and ( : ) and this operand.
This operator is known as conditional operator.
The general form of this operator is:
Conditional expression ( ? ) expression1 ( : )
expressional2
The conditional expression is value test first.
If the result is true, expressional is evaluated and is returned as the value the conditional expressional .Otherwise expression2 is evaluated and it is value is returned consider the following example
Y = 1.5x+3 for x<=2
Y = 2x+5 for x>2
This can be evaluated using the conditional operator statement as
Y = (x>2) ? (2*x+5) : (1.5*x+3);
goto statement :
C supports the goto stayement to branch unconditionally from one point to another i the program.
The goto requires a lable in order to identify the place where the branch is to be made , label is any valid variable name, and must be followed by colon( : ).
The label is placed immediately before the statement where control is to be transferred.
The general form of goto statement is :
goto label ; label: statement
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . .
label: statement ; goto label ;
forward jump backward jump
Great and love it
ReplyDeleteVery useful....
ReplyDeleteVery helpful....keep posting!!
ReplyDelete