I have a question regarding if
.
I'm developing a college semester program and every time I need to use a if
and at the end of if
, I need to go back to the beginning of the program. I'm having a hard time doing this.
Example:
NOTE: The code below is illustrative, because mine is very large and I will not be able to post here.
char op;
print("Digite algo");
scanf("%s", &op);
if (op == "nome") {
//algo aqui
}
if (op == "telefone") {
//algo aqui
}
if (op != 'nome' && op != 'telefone') {
//queria colocar algo aqui que fizesse o usuario voltar ao começo do codigo e pedir o valor da op pra ele de novo.
}
This question is also related to switch case
, where in default
I wanted to put something like this (From back to the beginning of the code).
Can anyone help me understand?