Hi to all
I have a quick question. How can go through the integer to find if there is any specific number. For example my input would be 234446 (integer is of type long),and now I would like to check that integer and find how many 4's are in there and then display it.
Appreciate it

Thank for reply
but it don't work, try yourself, I'm sending you piece of code. No matter what numbers you pick, it is just not right (or maybe its me)

#include<iostream.h>
#include<conio.h>
using namespace std;
int main()
{
long n;
int found5,found8;
long digit;
found5=0;
found8=0;
cout<<"Enter an integer: ";
cin>>n;
while(n>0)
{
n=n/10;
digit=n%10;
if(digit==5)
found5++;
else
if (digit==8)
found8++;
}
cout<<"We have: "<<found5<<" 5's and we have: "<<found8<<" 8's";
getch();
return 0;
}

Doing it that way skips the single's digit if the number is found there as you are dividing the number by 10 before you modulus by 10 on the first iteration and check for 4.

Example: 3334 on the first iteration would be:
3334/10
333%10

check:
if( 3 == 4) false;
counter does not update, remains 0;

Hello,
I'm new in java programming, i have insert amounts in database in this Format exp : 1.100.200,00 but the subtraction of this amount give false result .
here is ...

So for this program im trying to print out the max height the projectile reaches and when i run the str on the object it dosent change the value to ...

Is C similar to C# (C-sharp); or are they completely different ? I was wondering if I should begin learning C# and the transition to C will be a tad ...