Questions tagged as 'switch'

1
answer

Switch command does not work and does not display errors

I am trying to solve the following exercise: Elaborate an algorithm that assists in the control of a cattle farm that has a total of 2000 head of cattle. The database is formed by a set of structures (records) containing the following fields for...
asked by 12.05.2018 / 02:57
1
answer

How to check if something was passed to the php page?

It's even hard to ask because I do not know if it's okay, but I'll try to explain it as best I can. I have a page where I will use the php switch case to decide the action according to what is passed. However, if the page is only triggered witho...
asked by 14.02.2016 / 01:42
1
answer

Performance: switch or if aligned? [closed]

Regardless of language, switch performs better than aligning if s? If yes: why? if ... elif ... elif ... else ... end switch case ... case ... case ... else ... end     
asked by 20.06.2014 / 16:02
2
answers

Error with function $ _GET

My question is the following, I have the page criareditarevento.php that updates information from a registration system, however I need to make the update message open inside the page main.php which is the page where it has the...
asked by 14.06.2014 / 01:32
1
answer

Execution error on switch

#include <stdio.h> #include <math.h> int main () { int n1, n2, operacao, soma, sub, mult; float div; printf("Escolha a opecaracao que deseja realizar: "); scanf("d", &operacao); switch(operacao) {...
asked by 27.09.2018 / 18:27
2
answers

Infinite loop on the switch

The problem is that in all three cases, cout repeats infinitely. #include<iostream> using namespace std; #include<locale.h> int main(){ setlocale(LC_ALL, "Portuguese"); bool a; int consumo;...
asked by 15.08.2018 / 22:52
1
answer

"Switch" command enters "default"

For any value you enter, the result is always "None of the alternatives", where is the error? Follow the code: <body> <p>Clique para exibir...</p> <!-- <button onclick="myFunction()">Clique aqui</button>...
asked by 05.08.2018 / 20:43
1
answer

Problem with switch C

I have a code in C, and without the switch, it works fine, but with switch, when inserting name in the list, it replaces all the name of the list with the same one. void insChild(LIST* l, char name[]) { NO* new; NO* p; p = LastChild(*l);...
asked by 16.10.2017 / 19:04
2
answers

Problems with the switch

I'm experiencing problems with this code, when running it the default runs also being that at no time did I enter any data other than what is in the cases. // faz loop até usuário digitar a sequência de teclas de fim do arquivo while ((grade =...
asked by 15.10.2016 / 21:24
1
answer

Problem calling class inside Switch

I am developing a facul project that is a basic system for clinics. After the user logs in, he has chosen an option in the menu where the responsible class will be called. The problem that when I choose any menu option it again asks the user for...
asked by 20.06.2016 / 21:02