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
Explain thread in java?
What's a method in programming?
What does jenkins do?
What is core java used for?
Can we create our own wrapper class in java?
What is java and their uses?
What is double word?
How to create an interface?
What is multi-catch block in java?
What is private public protected in java?
Is it possible to compare various strings with the help of == operator?
What is difference between pointer and reference?
What do you mean by Hash Map and Hash Table?
What are the two types of streams offered by java 8?
Describe the term diamond problem.