Questions tagged as 'operadores'

2
answers

Operator "| "In Java

I can not find any material on the internet explaining the utility of the "|" operator in Java. I know there is the "||" (or) used to test conditions. if(foo == 'a' || foo == 'b') But what about the "|" operator? How useful is it? My...
asked by 29.09.2014 / 20:46
2
answers

Problem with ternary operator

I'm having trouble with the ternary operator. I want to use it to make the code more elegant because it is a simple thing. But it's like it does not work because it does not update the variable. The following example depicts the problem: #incl...
asked by 12.01.2018 / 15:41
1
answer

Operator & e * in functions

What is the meaning of this & in the front of the array (my function only works with & amp ;, I'm overloading cout <
asked by 03.10.2016 / 07:14
2
answers

Assignment Doubt in c

Here's my code, why if there is change in the other variables, am I not just changing the row by the variable value? what reason for the others to change? int a = 1, b = 2, c = 3, valor = 0; valor = a; printf("%d\n" , valor); valor = b++; pr...
asked by 08.08.2018 / 01:36
2
answers

Formal definition of operations = e ==

What is the formal definition of using = and == in Python? I can identify in the examples when I have to use which, but when I try to identify these operations by a formal definition as (more or less as if it were a mathematical co...
asked by 29.09.2018 / 03:37
2
answers

How to pass arguments by value in Python?

def somentenumeros(entrada): try: int(entrada) return True except: return False while True: cpf = input('Digite seu CPF ou digite os nove primeiros digitos ') if somentenumeros(cpf) == False or len(cpf)!=...
asked by 04.03.2017 / 12:52
1
answer

What is the operator for in the context of virtual memory paging?

I'm seeing the virtual memory implementation and I have this code: #define INDEX_FROM_BIT(a) (a / 8*4) #define OFFSET_FROM_BIT(a)(a % (8*4)) static void set_frame(u32int frame_addr) { u32int frame = frame_addr/0x1000; u32int idx =...
asked by 15.12.2015 / 22:35
2
answers

Display the first 5 numbers by 3, discarding the number 0

I can not display the first 5 divisibles by 3, I put a counter variable, but it returns another number. #include <stdio.h> #include <stdlib.h> int main() { int n = 20; for(int i=1; i<=n; i++) { if(i%3 == 0)...
asked by 02.03.2016 / 02:03
1
answer

Converting division expression in C ++ to C #

I have the following condition in C ++ and would like to move to C #. The problem I'm having is with the div function that displays the error:    The name 'div' does not exist in the current context if (quant > 0) { return d...
asked by 01.10.2014 / 18:37
1
answer

How do I return a valid result from an operation in PHP?

Hello. I want to return the result of an operation using two numbers and the operator as the parameter. It turns out that my result is a string. <?php $n1 = $_POST['n1']; //primeiro número $n2 = $_POST['n2']; //segundo número $operador =...
asked by 04.10.2016 / 19:54