Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a program to display the numbers having digit 9 in the
given range from 1 to 100

Answer Posted / neha

public class DisplayNumbers {
public static void main(String args[])
{
int num=0,Nine=9;
for(int i=1;i<100;i++)
{
int rem=i/10;

num=i%10;

if(num==Nine || rem==Nine)
{
System.out.println("Number is :: "+ i);
}
}
}

}

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I generate floating-point random numbers?

1058


What are the types of data structures in c?

1094


in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above

983


Where are local variables stored in c?

992


What are the different types of objects used in c?

982


Why do some versions of toupper act strangely if given an upper-case letter?

1046


What is difference between array and structure in c?

1108


Explain a pre-processor and its advantages.

1086


How can I find the modification date of a file?

1229


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2084


Is c procedural or functional?

989


What is struct node in c?

1028


A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers

1135


How to declare pointer variables?

1178


Explain what is a stream?

1045