class count
{
public static void main(String args[])
{
int a=0;
int i;
int l=0;
int b=0;
int c=0;
for(i=1;i<=1000;i++)
c=i/10;
if(i%10==0)
{
l=l+1;
}
else if(c%10==0)
{
l=l+1;
}
System.out.println("no of zeros in this string is:"+l);
}}
this is my code...to calculate number of zero from 1 to 1000,,,,but i have an problem in that code piz tell me right code,,,,thanks in advance,,,,hi;;;
m new to programming so please tell me m writig a program in java to calculate number of zero from 1 to 1000 using loop but dont get output yet piz tell me the exact code;;;;;;what i was doing is as follow::
class count
{
public static void main(String args[])
{
int a=0;
int i;
int l=0;
int b=0;
int c=0;
for(i=1;i<=1000;i++)
c=i/10;
if(i%10==0)
{
l=l+1;
}
else if(c%10==0)
{
l=l+1;
}
System.out.println("no of zeros in this string is:"+l);
}}
piz help....thanks in advance,,,,,!1