+ 1

if x is a float and I have the usual increment x++, will x be increased by 1, or by something else?

for instance, x=3.14 x++ will be 4.14?

15th Jun 2016, 1:37 PM
naghree
6 Respuestas
+ 2
Yes it will be increased by 1
15th Jun 2016, 2:01 PM
Aso Harutyunyan
Aso Harutyunyan - avatar
+ 1
thanks ;)
15th Jun 2016, 2:05 PM
naghree
0
but if you use loop you must use double
18th Jun 2016, 2:28 PM
raees
0
yes it increments one
19th Jun 2016, 7:07 PM
Iman Ali
Iman Ali - avatar
0
first u see, prefix increment(++x), postfix increment. x++ or ++x is increase by 1, eg, ++x=1+x; x++=x+1; if x=20; then ++x=21, or also x++=21..... nothing any changes with ++x or x++ now, let y=++x, here, x=10; so, we put x=10(initial value of x), y=11(value of y),x++=11(final value of x); so, ans is y(x)=11; and let y=x++, here x=5: we put x=5(initial value of x), y=5(value of y),x++=6(final value of x); so, y(x)=5;
18th Jul 2016, 9:00 AM
meherDev
meherDev - avatar
0
ur question is, x=3.14, so x++=4.14?; because x++ means x++=x+1; x=3.14+1 x=4.14; and if ++x=4.14? here x=3.14, so,++x=1+x; ++x=1+3.14 ++x=4.14; so, always remember ++x and ++x always x increase by 1;
18th Jul 2016, 9:10 AM
meherDev
meherDev - avatar