Questions tagged as 'switch'

1
answer

For inside a Java Switch

Good evening, I would like to know if there is a way to declare a 'FOR' within a SWITCH CASE in Java because Netbeans is accusing a bug well in this part. I'm trying to make an application to play a guessing game just like I read on the site...
asked by 21.04.2016 / 04:11
1
answer

Output condition in do-while in C code

I need the user to enter the numbers 1, 2 or 3 to choose the locations, and if not select one, ask again. However, when you enter the number 0 or 4, for example, it returns to the home screen (which would be the menu of destinations, costs an...
asked by 24.06.2018 / 23:36
1
answer

Using the switch function in C ++ [duplicate]

The function switch and I do not know what I'm doing wrong I want to put the name marcos ai appear "marks and legal" and put murilo "murilo e bacana". I'm doing this: #include <stdio.h> #include <conio.h> int...
asked by 10.09.2018 / 00:54
1
answer

Regex on a switch case

About I have a switch that takes care of activating my menus from their address on the website. switch($location.path()){ case '/perfil': $scope.menuAtivo.perfil = 'active'; br...
asked by 22.08.2014 / 20:44
1
answer

Switch entering the wrong case

I'm trying to solve the problem of Uri 1038 using switch , apparently the values are mixing, Item 3 for example multiplying by 2 (5 x 2) returns the value 3. What am I doing wrong here ? #include "pch.h" #include <iostream> using...
asked by 16.08.2018 / 19:30
3
answers

How do I make a switch button to switch css?

I have two CSS files for the same HTML and I would like to use a switch button to switch styles. The idea is to set up a switch "default layout" "new layout". I tried this, but I did not succeed. <div class="onoffswitch"> <inpu...
asked by 10.03.2017 / 13:53
2
answers

Iterate a list within switch

I would like to know how I can iterate a list in switch in python , type I have a list with ten values lista = [1,2,3,4,5,6,7,8,9,11] now I want to access this list value by value and create a loop conditional for each value h...
asked by 06.05.2016 / 00:27
2
answers

determining a string inside a switch in C

I have doubts on how to define a string inside a switch in C, without having to do a table of constants for this. The variable name_lanche is of type char, but this is the number of characters defined, so I am using it as a string. I ne...
asked by 07.09.2016 / 22:56
1
answer

Break does not work in foreach

I have a foreach inside another foreach that will rotate by several values of a specific object. But I need to stop both foreach's when it goes into if, but the break command does not work for some reason, it just keeps running both forea...
asked by 16.03.2017 / 15:13
1
answer

How to present only odd and even values with three variables in C?

My variables are: int codigo; --> Sendo esta variável para o switch int numero1,numero2,numero3; The user will enter three variables: printf("Digite o primeiro numero inteiro: "); scanf("%d", &numero1);...
asked by 28.03.2017 / 23:29