Programming in C' and Data Structure: Dr. Anand Kumar M.S. Engineering College Bangalore
Programming in C' and Data Structure: Dr. Anand Kumar M.S. Engineering College Bangalore
Programming in C' and Data Structure: Dr. Anand Kumar M.S. Engineering College Bangalore
Data Structure
C libaray
Loop may be executed zero times Minimum one time loop is executed
Pre test looping Post test looping
Example : any Example : any
goto statement
The goto statement transfers control to a
label.
goto statement provides unconditional
jump to a defined label.
Goto statement is usually used with if
conditional statement.
Syntax :
goto label_name;
label_name:
goto statement
goto down;
--------
--------
--------
down:
Statement;
goto above;
Statement;
Do
{
------------;
if(condition)
continue;
------------;
------------;
}
While(Condition);
Cont..
For(….;……..;…….)
{
---------------;
---------------;
if (condition)
continue;
----------------;
----------------;
}
Ternary (conditional)Operator
Ternary Operator is a conditional operator
which takes three argument.
Ternary (conditional)Operator
exp1 ? exp2 : exp3;
cond. true false
example : x = (a>b) ? a : b;
=> if (a>b)
x=a;
else
x=b;