Most voted "if" questions
The "if" statement is a control structure in many programming languages that alters the execution flow depending on a binary condition - also known as Boolean logic. This tag should be used when the question is related to the use and/or performance of the "if".
Learn more…467 questions
Sort by count of
-
-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
answer50
viewsNot falling in the if according to the number being higher or lower
The program I want to create should return an array with the number of records reached from a list of scores and the number of the position of the lowest score, respectively. However, it returns…
-
-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
votes1
answer92
viewsIf allows you to execute other unwanted lines
I want to make a program that allows you to manipulate and manage information about Cds that are stored in a text file. The file must save for each CD, the name of the author/group, CD name, year of…
-
-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
votes2
answers454
viewsPercentage with if in Python
Hello, I’m a beginner in Python and I came across a great question in a lesson I’m doing. I’m doing a program that takes user information such as: name, date of birth, position and salary. After…
-
-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:…
-
-4
votes2
answers68
viewsJavascript function using For
I have an array with the height of several students and need to sort in groups by height. I do a for to scan the array and inside the for a conditional if to know if the student enters that group,…
-
-4
votes3
answers171
viewsWhy does it return "Undefined" because it has an "if/Else"?
I have this logical condition using the if/Else! function area(largura, altura) { const area = largura * altura if (area > 20) { console.log(`O valor acima do permitido: ${area}m2.`) } else {…
-
-4
votes1
answer48
viewsI can’t use strcmp in C
I need to show a student’s chart using the license plate, as I do? #include <stdio.h> #include <stdlib.h> #include <string.h> main() { struct ficha { char matricula[9], inf[9];…
-
-4
votes1
answer28
viewsSalary adjustment calculation (according to category) with if Else only returns the first condition of 4. Javascript
I created a Javascript code with if Else to show on the screen the readjustment of a salary according to the category of worker selected in an input type ="radio". It turns out that only the first…
-
-4
votes1
answer69
viewsIs there a way back to a particular line of code?
I would like to know if there is any module, function, etc. that would allow me to go back to a certain line of code. I have this doubt because, whenever I want to ask a question repeatedly, I have…
-
-4
votes0
answers22
viewsIdeal Height Of One Person
Here is the code: Create a program that reads the ideal weight of a person of both sexes For men: (72.7*Height) -58 For women: (62.1*Height) - 44.7 print('PESO IDEAL DE UMA PESSOA')…
-
-5
votes1
answer43
viewsI have a script that I enter the number of months and returns the date of the deadline. But I need to decrease one day of the result
Dev’s good afternoon! I am trying to create a script that calculates the final date from an initial date and its term in months. Ex: Initial date: 01/08/2018 Deadline: 60 months End date: 31/07/2023…
-
-5
votes2
answers50
viewsIn if, when the user puts another state that is not specified, instead of entering Else, he enters if and continues the code normally
The code is like this: est = input('Qual estado reside atualmente? ') if est == 'São Paulo' or 'SP' or 'sao paulo' or 'São paulo': email = input('Digite o seu e-mail: ') tel = input('Digite o seu…