Questions tagged as 'operadores'

2
answers

Assigned operator

I can not understand why it does not execute the expression I want. Follow the code: $i = 1; $ranking = 1; $r = 0; for($i = 1; $i <=5; $i++){ $p = isset($_GET["n$i"])?$_GET["n$i"]:0; echo "$ranking ° Numero: $p"; $r += $p;...
asked by 05.01.2017 / 16:58
1
answer

Construct an array through a vector

I put nine digits in the vector but my array comes out with random numbers, I would like my array to come out with the numbers that are in the vector below below my code: #include <stdio.h> #include <locale.h> int vetor [9]; int m...
asked by 07.06.2016 / 23:39
2
answers

Program that adds / multiplies 2 numbers and what is between them and prints

I think the logic of this program is right, but the result is going wrong. Make a program that receives two numbers X and Y, where X < Y. Calculate and show: the sum of the even numbers of this range of numbers, including the numbers ente...
asked by 17.09.2015 / 21:03
2
answers

What is the # in the language Lua?

I'm watching this tutorial about creating a game and I came across something I did not understand about it of the language Lua. There is an excerpt of the code where the following expression exists: ents.objects[#ents.objects] What doe...
asked by 08.12.2015 / 18:25
2
answers

How to replace 1 bit of an integer without changing the other neighboring bits?

I want to change 1 bit and keep the same values as other neighboring bits. The bit operator shifts left or right by changing the 1-bit 0 bit, but it changes the entire 8-bit sequence. I did not want that to happen. Alternatively, I change...
asked by 18.06.2017 / 20:57
2
answers

how do I remove some numbers after the comma in PHP

How do I remove some numbers after the comma in PHP? ex: 25.52382832732732 ...  so I want it to stay only 25.52     
asked by 01.07.2017 / 23:25
2
answers

Doubt about the MOD operator in PHP

I have a PHP code that performs a given calculation, however it is something different from what I expect, I performed the calculations in hand and it did not generate the same result, could someone explain to me why? The code for executi...
asked by 04.03.2015 / 22:13
1
answer

lvalue required as left operand of assignment - remainder of division

I have a problem making the rest of the room. You gave this error:    value required as left operand of assignment How do I resolve this? #include <stdio.h> #include <stdlib.h> int main() { int x; printf("informe o numero i...
asked by 02.04.2018 / 20:15
1
answer

Bitwise operation

In my first semester of college I made an algorithm to avoid wasting memory, just for testing. Now I'm passing this code to C: Here is the whole code: // 8 bits // Aguenta até 4 slots (0 - 3) // Valor inteiro máximo suportado: 255 void...
asked by 16.03.2017 / 17:49
2
answers

How to use operator = to copy a vector of pointers?

Having this class, I would implement, operator =, copy the vector from pointers to int to another vector, is it necessary to reserve memory before doing so? What's the difference between making a builder per copy and implementing the assignme...
asked by 21.12.2016 / 22:05