I'm having some troubles... I'm trying to input a number, followed by an integer of multiple numbers. I am trying to count how many times the first number occurs in the integer. Now, I made this really easy code to show you what I actually am trying to do. The thing is, this code only compares two integers and tells me if they are the same or not. Mind you, I am very unexperienced in C programming, hence this question...
int main(){
int numberOne;
int numberTwo;
int count = 0;
scanf("%d", &numberOne);
scanf("%d", &numberTwo);
if(numberOne == numberTwo){
count++;
}
printf("Amount of equals found: %d", count);
return 0;
}
Now, if I'd have the following input: '1 1021023234', the output would be: 'Amount of equals found:0' The output should be (in this case) 'The output would be Amount of equals found:2'
I hope you guys can give me some tips.