in Programming in C edited by
1,750 views
0 votes
0 votes

Match the following with respect to the jump statements $:$

$\begin{array}{cIcI}   & \textbf{List – I} && \textbf{List – II} \\  \text{a.} & \text{return} & \text{i.} & \text{The conditional test and increment portions }\\   \text{b.} &  \text{goto} & \text{ii.} & \text{A value associated with it}\\  \text{c.} &  \text{break} & \text{iii.} & \text{Requires a label for operation}\\  \text{d.} &   \text{continue} & \text{iv.} & \text{An exit from only the innermost loop} \\    \end{array}$

$\textbf{Codes :}$

  1. $\text{a-ii, b-iii, c-iv, d-i}$
  2. $\text{a-iii, b-iv, c-i, d-ii}$
  3. $\text{a-iv, b-iii, c-ii, d-i}$
  4. $\text{a-iv, b-iii, c-i, d-ii}$
in Programming in C edited by
1.8k views

3 Answers

1 vote
1 vote

Option A

1 vote
1 vote

This Answer(A) is to consider C Language as Default

List – I                                List – II

a. return                  ii. A value associated with it

b. goto                   iii. Requires a label for operation

c. break                 iv. An exit from only the innermost loop

d. continue            i. The conditional test and increment portions 

Return The return statement terminates the execution of a function and returns control to the calling function. Execution resumes in the calling function at the point immediately following the call. A return statement can also return a value to the calling function. See Return Type for more information.

Goto : A goto statement in C programming provides an unconditional jump from the 'goto' to a labeled statement in the same function. But is not good to use this statement in program because it makes difficult to trace the control flow of a program, making the program hard to understand and hard to modify.

Break : In C-Language it can be used at 2 places .When a break statement is encountered inside a loop, the loop is immediately terminated and the program control resumes at the next statement following the loop.Or
It can be used to terminate a case in the switch statement

Continue : The continue statement in C programming works somewhat like the break statement. Instead of forcing termination, it forces the next iteration of the loop to take place, skipping any code in between.

0 votes
0 votes
use of break : exit from innermost loop only

goto   a:  a is label

return(n)   n is the value  associated

continue just test the condition in between the loop and increments without any oeration

so ans should be A

2 Comments

What if we write just "return" ? We cannot return a value if the return type is void.
0
0

Well in the given matching return can only be associated with  value

and if return type is void then why we will use return statement just will perform some action(or we perform nothing) and it will take us to the calling function

0
0
Answer:

Related questions