I need to find the location of certain digits in an array of numbers

Nvm, problem solved
Last edited on
I don't understand what you're asking - If you want a digit within a number, you use the modulus (i.e. 2020, last two digits obtained by calculating 2020%100).

If you want to find the min/max, it usually looks something like this:

int lowScore = 100;

for (int i = 0; i < 10; i++){
if arrayVariable[i] < lowScore;
lowScore = array[i];
}
return lowScore;

Last edited on
what are you trying to do with this statements ?
1
2
3
4
5
6
7
for (int i = 0; i < userNumInteger; i++) {

	*(iPtr3 + 1) = *(iPtr2 + 1) = *(iPtr + 1);

	std::cout << "\nEnter digit #" << i + 1 << ": ";
	std::cin >> *(iPtr + 1); 
  }


------
if (value != 0, value2 != 0, value3 != 0) {
remember that when separating expressions inside if, while etc.., we separate it by using
logical operators, or ( || ) or and ( && )
Last edited on
Topic archived. No new replies allowed.