Can someone tell me about goto statement on c++ and give an example too.
:) thank you
Do not give the answer by copying.
Share
Can someone tell me about goto statement on c++ and give an example too.
:) thank you
Do not give the answer by copying.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
I didn't understand the meaning of c++
A go to statement provides an unconditional jump from the goto to a labeled statement in the same function.ex-
#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;
}
hope it helps!!!!!!!