Most voted "operators" questions
Operators are symbols that occur in almost every programming language and coding, for performing calculations and comparisons on data. Use the tag only when operators are relevant to the problem, including questions about syntax, in any language.
Learn more…330 questions
Sort by count of
-
0
votes1
answer59
viewsRange of values to compare
When I ask for a random value on Math.Random() I want him to say whether it was normal, disaster or failure, but I can’t get him to talk normal because I need him to say when he’s over 2 and under…
-
0
votes1
answer48
viewsDoes anyone know how to convert int variable to bool?
The L variables would be sides of a triangle, I put them as int and I’m trying to convert to bool, I saw some people saying that this is not possible, so what kind of variable will I use and what…
-
0
votes1
answer47
viewsUse of multiple conditionals in an SQL query
I’m wondering how to perform a query with different conditionals. The query is a login validation, I need to check if the data contained in the user input is equal to the username or email or Cpf…
-
0
votes1
answer54
viewsPython bitwise operator output
Why the value of ~True is -2 and that of ~False is -1? The logical operator equivalent not, in not True, results in False and vice versa.…
-
0
votes0
answers17
viewsWhat this symbol means in C (->) language
Hello I’ve been coming across a lot with this symbol in C "->" language, without the quotation marks someone knows what it means ?
-
0
votes0
answers24
viewsWould you like to learn about the operator "," in C and C++?
I will put the example of a code I saw below: while(scanf("%d %d %d %d", &h, &u, &d, &f), h) {... } the input stopped when h received value 0.
-
-1
votes1
answer49
viewsWhat would be the name of this "technique"?
int valorNo = (p->left == NULL && p->right == NULL) ? p->key : 0; I saw it in an answer here in the stack and I have no idea how it works, much less how to "read" it.…
-
-1
votes1
answer221
viewsHow to validate if ternary operator was used in the implementation?
I want to validate through the TDD if in the implementation was applied ternary operators. How can I measure this situation? def par_impar(x): return "impar" if x % 2 else "par" Or this other?…
-
-1
votes1
answer81
viewsMeaning of signs in C#
What are the signs < >, [ ], { }, ( ) playing games in Unity?
-
-1
votes1
answer41
viewsSubtraction result with double many decimal places appear
I’m starting at Dart and went to perform a simple subtraction operation with double but the result is very strange. For example in a subtraction of a salary of 3000 minus the ceiling of inss of…
-
-1
votes1
answer45
viewsLogical operators indicating a range between numbers
is a simple question: how to specify a range of numbers using operators logicos? for example: if the number typed is between 1 and 10,notify that is too little? this syntax is valid?…
-
-1
votes1
answer46
viewsLogical operators with different value
nome_adc_1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { double percent = (estimatedFare*0.20); double soma = estimatedFare + percent; double subtrai =…
-
-1
votes1
answer45
viewsHow does the sum assignment operator work internally?
I am creating a class and I want its objects to be summed up, using the sum operator or the sum assignment operator. I know that to use the sum operator, we must create for the class the special…
-
-1
votes0
answers25
viewsEquality Operator error != in Java
Good morning, I was training in Java and was building a form so I made a way that if the person enters an invalid data will run a do while with the same question (I don’t know if this is the right…
-
-1
votes0
answers21
viewsPython if function
Hello, In a database with vaccine information per day, I want to compare whether the sum of each laboratory (Sinovac, Pfizer and Astrazeneca) is different from the reported total. If it is, I want…
-
-2
votes3
answers218
viewsWhat makes the expression "'2 pigs' + '3 horses' == '5 animals'" return true in PHP?
I’ve asked a similar question here at Stackoverlow at: Why in PHP the expression "2 + '6 apples'" is 8? However, taking a look at some strange things curiosities that exist in PHP, I saw that the…
-
-2
votes1
answer791
viewserror expected Primary-Expression before ' ' token
Error on line 21. #ifndef __STRING_H__ #define __STRING_H__ #pragma warning(disable: 4786) #include <string> #include <vector> const int MAX_RESP = 4; typedef…
-
-2
votes1
answer55
viewsHow to use the ternary here?
$rs = $pbc->selectPublication(filter_input(INPUT_GET, 'id', FILTER_DEFAULT)); I have this code that is passed as argument of the method to select the posts on the system, but how can I use it…
-
-2
votes2
answers293
views"if" does not match the condition
I’m trying to apply a if in my code, but it’s coming wrong: <?php echo $usu_id . "<br />"; echo $centraliz . "<br />"; echo $marca . "<br />"; if($centraliz = "S"){ echo "É…
-
-2
votes1
answer146
viewsTable test result is not the same as compiled?
The code below when executed returns the result to m = 0, but doing the test table the result should be -2. I can’t prove the 0as a result unless the variable t++ when in (t * t++), only at this…
-
-2
votes1
answer1738
viewsHow to make an if with a higher and a lower value?
I was wondering if it’s possible to make a if or a for in PHP as follows: $valor = 7 if ( $valor se o valor for maior que > 5 menor que < 10) { //... Comando a ser executado ... }else if (se o…
-
-2
votes1
answer425
viewsHow does the new Java operator work?
I don’t understand how new works below: public Main(){ System.out.println(""); } public static void main(String[] args){ new Main(); }
-
-3
votes2
answers94
viewsWhat does the expression "!(errS&errE)" do in the if?
In a piece of code I need to understand, a new syntax appeared to me on if: if (!(errS&errE)) { fprintf(stderr, "\nFALTA ARGUMENTOS\n"); if(!errS) fprintf(stderr, "-s NOME ARQUIVO SAIDA \n");…
-
-3
votes2
answers126
viewsHow to operate on the counter of a while in each loop iteration
Sorry my ignorance I’m starting to learn python now, my doubt is: How can I generate a result in each iteration of a while. valor= input('digite o numero desejado:') contador = 0 while contador…
-
-3
votes1
answer23
viewsForce the user to answer a valid alternative in a multiple choice Python question system
The code below works well, but I would like it to ask the specified question again if the user does not type one of the three available alternatives. perguntas = { 'Pergunta 1': { 'pergunta':…
-
-4
votes1
answer63
viewsWhat is the best way to use different logical operators in the same condition?
Precise using two different logical operators in the same condition. How to do it right? I did it this way: if($planohabilitargestao!="1000" || $planohabilitargestao!="200" ||…
-
-4
votes1
answer56
viewsProblem with exponent operator in function
destaquei o problema e descrevi na equação: M = 1000/(10 - Vinc(10)**2/299792458**2)**(1/2) //////////////////////////////////////////////////////////////////////////////// import matplotlib.pyplot…
-
-4
votes1
answer51
viewsHow can I get this code to display the first 100 even numbers not multiples of 10?
#include <stdio.h> #include <conio.h> int main () { int count; for (count=0;count<200;count=count+2) printf ("%d \t ",count); if (count%10==0) { count++; } getch(); return(0); }…
-
-6
votes1
answer72
viewsVariable validation
I saw some examples of variable checking to set values. For example: $nome ?? "Tem nome"; $nome or "Tem nome"; In this case, you have the reverse validation? I’d like to do something like that:…
-
-7
votes2
answers135
viewsOver or under age
Good afternoon, everyone. I’m a beginner and started a Javascript course. I’m trying to do this exercise: Make a Script to ask the user for his name, age, city of birth and UF. Write on the page the…