Questions tagged as 'operadores'

3
answers

c ++ Problem when dividing 2/3

I need to multiply an X value by 2/3 (Two Thirds), for which I am using the following: #include<iostream> using namespace std; int main() { double var; var=2/3; cout<<var<<endl; return 0; } and to my sur...
asked by 26.10.2017 / 03:32
2
answers

How the operator works || in this case?

This code apparently checks if a variable is true, and if not, creates the variable: (function(a){ a || (a = "Default value"); })(); Why does it only work when the defect is made with parentheses? , I mean: (a = "Default value") Also,...
asked by 15.12.2017 / 04:21