Most voted "else" questions
104 questions
Sort by count of
-
0
votes3
answers2371
viewsHow to use one if inside the other?
The problem is the following 2 football teams, wanted to create a decision where it would show "Brazil won" or "Argentina won" or "There was a draw". But I can not create three decisions, follows…
-
0
votes2
answers728
viewsSwap elseif code for switch case
I’m having trouble modifying a code I made in else if for switch case. I’m not getting the code to work, he gets values and operation by $_GET and does the selected operation: I leave the code here:…
-
0
votes2
answers153
viewsWithout the if explanation
As far as I know, else should be below the if, corresponding it, but in the code below, Else is not next to the if , because it is outside the repeating structure, to be more exact, the else is not…
-
0
votes1
answer59
viewsCounters are not being incremented in code
I am facing some difficulties with the code snippet below: The call of this function is: cache = OperaCache(true , endereco, op, cache, descricao, read_hits, read_misses, write_hits, write_misses);…
-
0
votes1
answer263
viewsIf it works but Else doesn’t
Then, the code below (is complete in https://codepen.io/RaoniSousa/pen/Zpkxbb), the if works but this Else No, what is wrong? I would like it to work like this one, in the "NAME" input by scrolling…
-
0
votes0
answers7
viewsif Else in assigning a Python variable
I want to understand that "ma" assignment on line 6 and "me" on line 7. I don’t even have a focus on understanding what the code does, I just want to understand this attribution with if I hadn’t…
-
0
votes2
answers69
viewsCreating rule to create time based on delivery rate
I have a condition in my form that calculates the delivery time of orders, follows below the rule: date_default_timezone_set('America/Sao_Paulo'); $Agora = date('H:i:s'); $HoraServico =…
-
0
votes2
answers498
viewsHow to use if Else in the code below
Starting I type the artist’s id and the other data, then I will enter the repairman’s id, I need that when typing the repairman’s id, if it is equal to the artist he should not accept and ask for…
-
0
votes1
answer31
viewsPutting minutes into working time
I have the following code, where determines the time of operation of Delivery. Follow code: function delivery(){ var cep1 = document.getElementById("cep1").value; var cep2 =…
-
0
votes1
answer52
viewsUpdate variable in IF
Good morning, I am unable to update a variable within the IF structure and use it later in my code. Follows excerpt from my code: while ($dado_participante = mysqli_fetch_array($qry2)) { //REGISTRO…
-
0
votes1
answer498
viewsRedirect pages using if, Else if and Else attributes what is wrong?
my php code <?php include "conectar.php"; //comando para iserir dados direto do formul?rio para o banco de dados $nome=$_POST["nome"]; $cpf=$_POST["cpf"]; $identidade=$_POST["identidade"];…
-
0
votes3
answers619
viewsif error inside if
I have a problem, in my view the logic is correct, however it is not working, I have a select that has to be checked and if it is selected certain option it opens another select, in that other…
-
0
votes2
answers128
viewsIf Else Statement problems chained in C language
I’m starting in programming and had enough difficulty to understand If Else in a chained way. I came across the following situation, when running the code only the first or second condition…
-
0
votes4
answers428
viewsReceive various values and print only the 3 largest ones in c
Hello, I have an activity to be done that consists of receiving values and only stop receiving them when typing -1, then the program should display the 3 highest values typed as if it were a ranking…
-
0
votes1
answer53
viewsWhy are you returning "Invalid Position"?
When I type 3, instead of asking for the Position I want to enter, it returns 'Invalid Option'. Could anyone tell me why? Follow the code: #include<stdio.h> #include<stdlib.h> int…
-
0
votes1
answer177
viewsIf function with decimal numbers
I am a designer and an adventurer in programming and eventually adapt some codes in projects. I have a situation here that I couldn’t handle on my own. The following code analyzes the value entered…
-
0
votes1
answer40
viewsNested structure giving error
I’m trying to create a script that reads if the person is older or younger. I would like if for example only 1 person is bigger, it writes '1 person' and not '1 people', but my code is giving some…
-
0
votes0
answers65
viewsHow to do an IF/ELSE SQL check
If anyone can help me, I really appreciate... I am beginner and I am not able to develop the following check: If substring (tasks, 9, 1) = S, it should delete only in the Startup tables If substring…
-
0
votes1
answer799
viewsHow do I use if inside the for, without the outside if appearing?
printf("\nDigite o usuario que deseja pesquisa, pela Matricula: \n"); gets(strL); busca=atoi(strL); for(i=0; i<quant; i++) { if(busca==dados[i].matricula) { printf("Aluno: %d\n",i); printf("Nome:…
-
0
votes1
answer127
viewsCode with if and Else does not work
#include <stdio.h> #include <math.h> #include <stdlib.h> #include <time.h> main() { int n1, n2, n3, n4, n5, ma, mp, mav, mev, dp, p1, p2, p3, p4,…
-
0
votes1
answer44
viewsDoubts about if clause
I have a problem in the query below: THERE ARE SOME DATA THAT ARE ON D1_NFORI, THAT MISSING "0" THE LEFT WOULD NEED TO INCLUDE THE ZEROS TO COMPARE IN THE WHERE EXAMPLE: Where IF D1_NFORI NOT LIKE…
-
0
votes1
answer58
viewsDoubt if/Else (Javascript)
I’m starting to study programming and JavaScript I had an obstacle with the if/else. In the code, the if always performs, but the else no, I’ve made several modifications (including adding the…
-
0
votes1
answer30
viewshow to include letters in my list in python and inform the user that it has been repeated
for letra in palavra_secreta: #print(inclui_Letras) if (chute == letra): letras_acertadas[index] = letra inclui_Letras.append(letra) # incluir o 'chute' na list 'inclui_letras print(palavra_secreta,…
-
0
votes0
answers17
viewsConditional - If, Elif, Else
I am a beginner in Python and I have the following script running by Vscode and Pycharm terminal. from math import pi import sys def help(): print("É necessário informar o valor do Raio.")…
-
-1
votes1
answer409
viewsIf Else if in Javascript
I’m developing an application using phonegap/Cordova that stores data using localStorage and I’m having a problem with javascript... I’m calling a function to save() my data, a function to load()…
-
-1
votes2
answers417
viewswhat I must do to authenticate the user correctly
I’m in need of help to authenticate users on my site but I don’t know what the sql variable that I hosted returns when you find the right user what I put in if? <?php include 'conexao.php';…
-
-1
votes1
answer55
viewsI need help with this code
Personal I wrote the following simple code in my python: nome = str(input("Qual o seu nome?")) if nome == 'denise': print("Nome bonito") elif nome == 'maria' or nome == 'pedro' or nome =='joao':…
-
-1
votes3
answers81
viewsHelp with code reduction in If/Else
I am trying to clean the body class without having to put this amount of code in if/Else function bgColor(event) { evento = event.target if (evento.classList.value == 'vermelho') {…
-
-1
votes1
answer499
views -
-1
votes1
answer91
viewsNull input via keyboard in a variable receipt via Javascript
Good night! In my practical Javascript experiences, I tried to create a condition to alert the user about a variable he missed by pressing the key enter twice. However, in trying to solve this…
-
-1
votes3
answers2084
views -
-1
votes1
answer22
viewsCompare 4 Variables and execute unique code for each result
Hello, I’m trying to create a comparison where the next action will be different for each variable value someone can help me. The intention is if the value is true, executes one function if it is…
-
-1
votes2
answers39
viewsShellscript for returning bank values each value in 1 different variable?
Hello I am trying to return 1 value for each variable I can return however, I am trying to create a condition that applies to one for which are true and which are false and display me on the screen…
-
-1
votes1
answer293
viewsPython programming (calculating average with shares, average case less than set value)
I need your help to solve an issue of my programming course, I have an initial activity and do not know where to continue, I need to create a program that gets 2 grades, disappear and divide by two…
-
-1
votes1
answer40
viewsJavascript IF and ELSE difficulty - Return result text on screen
DOUBT: How to make an IF ELSE with javascript to display a text (Ex: Approved) when locating a given word (Ex: Green). My current code is this below, but it’s not working and I can’t find the…
-
-1
votes1
answer47
viewsif Else - Does the position of the keys "{}" make a difference in the result?
I’m making web Scrapping from a website. And for that I need to check if a data.frame exists or not. Besides not being working, I realize that I have different results only changing the position of…
-
-2
votes1
answer692
views -
-2
votes1
answer57
viewsWhy doesn’t print return all the items in a list?
The following code should return all cars from the following list: cars = ['audi','bmw','subaru','toyota'] for car in cars: if car == 'bmw': print(car.upper()) else: print(car.title()) But he only…
-
-2
votes1
answer36
viewsBash - current date and calendar with "if Else"
#!/bin/bash echo "1 - calendario" echo "2 - data" echo "opção: " read var if [$var -eq 1]; then calendario=$(cal) echo $calendario elif [$var -eq 2]; then now=$(date) echo $now else echo "opção…
-
-2
votes2
answers160
viewsJob Seekers Information Filter
A program that provides information on job applicants: The number of candidates per sex.... There is an error in this if, ta returning only m or just f package livroex_pag69; import…
-
-2
votes2
answers139
viewsWhat’s wrong with my code?
I wanted to create a system that asked the nationality of the user and if he answered "Brasileiro", the if would lead to a response. Should any other nationality, the else would take you to another,…
-
-3
votes1
answer62
viewsHi, I’m new to Python, and I’m having trouble with a Syntaxerror on an Else
It appears to be written in the right way, but is still making a mistake. No matter what I do the error continues, I have already tried to exchange for an Elif, for an if, but nothing right. Always…
-
-3
votes1
answer27
viewsUse information from an Event in if Else
People, I’m doing an exercise to create a set of stone, paper and scissors. Within the development I arrived at a problem, my if statement is not working. To with 1 month of programming only, then…
-
-3
votes1
answer89
viewsYou are giving variable not defined within an if
Art. 42. Can adopt the over 18 (eighteen) years, regardless of marital status. § 1º Cannot adopt the ascendants and the brothers of the adopting. § 2º For joint adoption, it is indispensable that…
-
-3
votes2
answers36
viewsExercise with ongoing scanner, does not perform correctly
I’m studying in a game development course using Java, in one of the classes is proposed an exercise using scanner,but when trying to execute the code does not execute correctly. the code in question…
-
-3
votes1
answer27
views"Segmentation fault(core dumped)" error in C language if-Else program
Greetings! I’m a beginner in programming and found this problem in a code: Segmentation fault (core dumped), after entering the first variable. That is the code: #include <stdio.h> #include…
-
-4
votes2
answers270
viewsLanguage C - Structure jumps directly to ELSE ignoring IF parameters
#include<stdio.h> int main(){ //Escolhe entre nome do personagem e classe int p,c; printf("RPG teste\n"); printf("Digite um nome para o seu(a)…
-
-4
votes1
answer235
viewsCould someone help me with a JS exercise? CONDITIONAL
Guys, help here, please! I need to make this code work. I’ve tried everything and keep going wrong. Like you would do? Sets the function today Magazine, which receives by parameter a string that…
-
-4
votes3
answers76
viewsWhy doesn’t my Eps work?
const alun = document.querySelector("#bottomaluno") alun.addEventListener('click', addaluno) function addaluno() { if(display = 'none') { …
-
-4
votes1
answer42
viewsphp code if does not run only Else
<form method="GET"> salário: <input type="number" name="salario"> <br> tempo de serviço (em meses): <input type="number" name="tds"> <br> n° reclamações:…