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...

Scenario: There are 1 to 100 numbers. Each number should be
keep in the each column like from A column to Z column ie 1
to 26. From 27 to 52 should be in 2nd row in the excel
sheet. This has to be continue till 100. How do you write
Java program and what are various methods.

Answer Posted / vishal

public class NumberPlacing {

int k=0;
int n=4;
int val=0;
int[]a=new int[101];

public void printInTabularForm(){
int noOfRows = 100/26;
int rowStart = 1;
int setEnd = 26;

for(int i=rowStart; i<=setEnd; i++){
System.out.print(i+"\t");
if(i == 100){
break;
}else if(i==setEnd){
rowStart = i;
setEnd = i+26;
System.out.println();
}
}
}

public static void main(String args[]){
NumberPlacing num=new NumberPlacing();
num.printInTabularForm();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is numeric function?

947


What is the purpose of static keyword in java?

902


What is the purpose of stub and skeleton?

954


Why does java have different data types for integers and floating-point values?

946


Which is a valid identifier?

1097


Why is inheritance used in java?

1057


Difference between doublesummarystatistics, intsummarystatistics and longsummarystatistics ?

938


What is the difference between yielding and sleeping?

1027


What is the difference between iterator and list iterator?

964


How do you escape sequences in java?

1006


What is the advantage of functional interface in java 8?

936


How many ways can we create the string object?

958


Explain illegalmonitorstateexception and when it will be thrown?

1034


What do you mean by platform independence of Java?

1062


How finally used under exception handling?

895