429 questions
1 vote
2 answers
70 views
Why are these results different between two types code of Java? [duplicate]
First of all, my mother language is not English. Now I study Increment(++) ande Decrement(--) operators of Java. I tried an issue. But the result of mu code differents from my expectation. Issue ...
0 votes
1 answer
46 views
Why is my angular datetimepicker adding increment/decrement text over arrows on input?
I can't figure out why my datetimepicker in my angular project is suddenly adding these weird lines of text over my arrows on the time input. They appear to be related to increment/decrement hours/...
0 votes
1 answer
108 views
Decrementing numbers based on total percent change to reach a desired average?
I'm trying to decrement numbers across 12 months based on total percent change but keep the average of the numbers consistent. I've tried a few different approaches that have not resulted in what I'm ...
0 votes
1 answer
604 views
Increment (and Decrement) values in a [Google Sheet] column
The image (attached) is a simple "AppScript" adapted from a popular YouTube ...that allows "Values" (in a column) to be increased by 1 - by clicking an "Arrow" (button) - ...
2 votes
2 answers
127 views
Pointer Increment and Decrement(*--*++p) in c
#include <stdio.h> int main() { static char*s[] = {"6642321","93456","134098","55513"}; char ** str[] = {s+3,s+2,s+1,s}; char ***p = str; ...
-2 votes
1 answer
101 views
Why doesnt decremented pointers return the right value?
I am trying to decrement a pointer while setting values to what the pointer is poiting to. When setting the values they show that they have been properly set, but when trying to retrieve them again it ...
1 vote
1 answer
215 views
Increment/decrement button React.js/Redux
I know similar questions have been asked, but I couldn't find one which I could adapt to my code (possibly cause I am still new to Redux). So, I am editing the cart functionality which was already ...
0 votes
2 answers
92 views
Unclear behavior of ++/-- operators in sample insertion sort
I was practicing writing some sorting algorithms and wrote the following code for insertion sort: public static void insertionSort(int[] nums) { for (int i = 1; i < nums.length; i++) { ...
-2 votes
1 answer
75 views
How does post-increment work in this case? [duplicate]
int value = 10; value = value++ + --value; Console.WriteLine(value); I already know the result, but I want to ask how correctly I understood the sequence of actions. Initially,...
1 vote
4 answers
398 views
Output when using pre decrement in for loop in C
As you can see this the code in C, here I have used in for loop --i for decrement but I am not getting the expected output. Please explain #include <stdio.h> #include <stdlib.h> int main()...
-4 votes
1 answer
142 views
Algorithmic Problem/Code Challenge. JS Function incrementing/decrementing Strings in the lexicographically smallest step possible [closed]
I need a js function, that increments Strings lexicographically, by incrementing or appending letters(A-Z, a-z) only, it gets passed an initial string, and the amount of increments n. It returns an ...
4 votes
3 answers
268 views
Is decrement of bool variable defined in С?
This question is about С. Say we have a code like this: bool a = false; a++; printf("%d\n", a); a--; printf("%d\n", a); This on my x86-64 linux machine shows: 1 0 That was not a ...
2 votes
1 answer
3k views
Increment or decrement array elements by 1
I need some help solving the following competitive programming question. Given array A of size N .now you can make K operations where in each operation you can increase or decrease an element in array ...
2 votes
2 answers
112 views
Is the behaviour of this statement of assignment and decrementation well defined?
The following statement does not really make sense: value = value--; I accidentially wrote this instead of just value-- or value = value-1 . But since it worked on my machine as intended, the error ...
2 votes
2 answers
56 views
stopping counter at 0
I have two functions that increment and decrement number of items by 1, but when I decrement I want to stop at 0? this are the functions const addToCart = (productId) => { setCartItems((prev) =&...