Computer Science, asked by divyanshsharma111020, 6 months ago

While executing goto statement' what do you feel? Does it require extra time for carrying a jump either forward or
backward by the compiler while executing the code?​

Answers

Answered by ajayyd463
1

Answer:

#include <stdio.h>

int main()

{

  int sum=0;

  for(int i = 0; i<=10; i++){

sum = sum+i;

if(i==5){

   goto addition;

}

  }

  addition:

  printf("%d", sum);

  return 0;

}

Output:

15

Explanation: In this example, we have a label addition and when the value of i (inside loop) is equal to 5 then we are jumping to this label using goto. This is reason the sum is displaying the sum of numbers till 5 even though the loop is set to run from 0 to 10.

Explanation:

Answered by princejha2062
1

Answer:

Thanks for Free points

Similar questions