Questions tagged as 'if'

1
answer

Specifying height and sex of students with a "while"

The exercise asks me to read 20 students and their respective heights and sex, and then show the average height and how many men and women we have. What I did was the following: int main() { float altura, media; char gen, mediam, me...
asked by 09.04.2018 / 15:15
0
answers

Why is the statement not being executed?

I am creating a program that sorts a matrix of structures, first sorts the rows and goes to each row and arranges them by columns. In the array that I am using at the end of two cycles the value of (i+1 = 4) , when I call again the functio...
asked by 28.04.2018 / 16:42
1
answer

If within PHP Field

Good afternoon, How to do an if within variable value assignment. $html =' <body> <table width="100%" style="background:#00aeef;"> <tr><td> <table width="596" border="0" ali...
asked by 18.07.2017 / 19:51
1
answer

How to put a variable alert in the onclick parameter of a link? using jquery and php

I need to put a product message unavailable on my system, which takes the available status of the db (YES or NO) I did an IF that changes the image of the product when the status is NAO but I want a message if the user clicks on it saying that t...
asked by 30.03.2017 / 02:57
1
answer

How to make conditional receive a parameter followed by an argument

I've been trying to create a if..else structure with a passing parameter. See: Example $ opt-get -i pacote.tgz    This, I'm creating something similar to the apt-get tool of the Debian Operating System . I have made...
asked by 03.12.2016 / 23:22
1
answer

else condition being called at the wrong time

I'm currently having trouble with a job code. My ELSE class is always being executed, but only when I choose the option for the first IF. import java.util.Scanner; public class BikeFit2 { public static void main( String[] args ) { Scanner...
asked by 14.09.2016 / 19:09
1
answer

If else if in Javascript

I'm developing an application using phonegap / cord which stores data using localStorage and I'm having a problem in javascript ... I'm calling a function to save () my data, a function to load () and a rank () function. I am checking the local...
asked by 19.09.2016 / 02:36
0
answers

PHP / Bootstrap - Repeat until X and then until Y then adds new DIV and continues the replay

I'm breaking my head in this repetition, as this is my first question, sorry for the mistakes. :) I'm currently with this code block inside the container: <?php echo '<div class="row">'; $posts = DBRead('posts', "WHE...
asked by 07.08.2015 / 15:50
2
answers

Use IF function in SQL as if it were excel [closed]

Is there a function in SQL equivalent to IF ( SE ) of excel? I need to do a logical test that in excel I would write =SE(B1_UM = "UN"; D2_QUANT / B5_QE1;D2_QUANT) . Here is my query: SELECT D2_FILIAL, // Um monte de...
asked by 16.05.2018 / 20:43
0
answers

How to work with if and else?

Good morning. I would like to get help from you to build this code because I am not able to implement it. $query1 = "INSERT INTO paciente VALUES ('NULL, $nome_paciente, $nome_doutor')"; $id_paciente = mysql_insert_id(); $query2 = "INSERT...
asked by 06.05.2016 / 15:56