Questions tagged as 'if'

2
answers

How to test the factorial in Main ()?

How would main() of this function be? The user types a number and the factorial of the number appears on the screen. int fatorial(int num) { if (num >= 0) { int fat = 1; while (num > 0) { fat *= num; num--;...
asked by 21.02.2017 / 14:58
1
answer

Make an INNER JOIN using the IF

I'm doing an INNER JOIN from the Combo Table with the Product Combo Table as I show below ... SELECT C.SchoolID, C.ComboID, P.Active, P.Name, P.ProductID FROM sales.Combo AS C INNER JOIN commons.Stock AS S ON C.SchoolID = S.SchoolI...
asked by 16.04.2014 / 18:55
2
answers

Conditional structure does not work

Several times, especially when the second price is higher than the others, the program charges that it is the cheapest. #Faça um programa que pergunte o preço de três produtos e informe qual produto #você deve comprar, sabendo que a decisão é...
asked by 31.12.2018 / 20:05
2
answers

How to tell if an NSArray is empty (or null) using IF

I need to know if an NSArray is empty or null using an if. Code: NSArray* array; if( array == nil) { // Fazer algo }     
asked by 08.09.2014 / 02:58
1
answer

Alternative for If / Else

I have the following code: private void maskedTextBoxEAN_Leave(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(maskedTextBoxEAN.Text)) if (!ValidaEAN13.CalculateChecksum(maskedTextBoxEAN.Text)) CaixaMensage...
asked by 13.08.2016 / 03:18
1
answer

Else does not work in PHP

I'm trying to use the code below, but else does not work. Returns the error Parse error: syntax error, unexpected 'else' (T_ELSE) <?php if ($status == 'True') ?> <div class="col-lg-3 col-md-3 col-sm-3 col-xs-3"> &...
asked by 19.02.2017 / 01:12
1
answer

Error creating variable inside IF

I was creating a script that always worked for me, however, I made a small change that almost exploded my mind because I did not understand what happened and I did not find anything on the subject. It is as follows: This code works perfectly:...
asked by 15.09.2018 / 22:55
1
answer

Doubt about radio button

I have a form that has two radio buttons: 1-masc 2-fem. I want when one of them has pressed, and I click on "compute" it pulls the%% of% indicated for each if . <form name="calc" method="post" enctype="multipart/form-da...
asked by 08.12.2015 / 20:34
1
answer

Four different conditions using awk if (unix)

Hello I need to do an awk if command using 4 different conditions together, example of my input only for a few lines (I have an input with thousands of lines) chr17_30 1 chr1_72 0 chr1_46 2 chr1_47 -1 chr1_48 1 Output desirable c...
asked by 25.09.2015 / 14:58
1
answer

Select notes to be printed

I need to print only those annotations above > = 6, where in the code do I put if or some other statement? I tried and could not find the right place. #include <iostream> #include <string.h> using namespace std; #defi...
asked by 20.10.2014 / 20:00