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 / ashwin khandelwal
public class NumPlacing {
int k=0;
int n=4;
int val=0;
int[]a=new int[101];
public void done(){
for(int j=0;j<n;j++){
if(val<101){
for(int i=0;i<26;i++){
val=val+1;
int count=i+1;
a[val]=val;
k++;
System.out.println(count+"->"+a[val]+"\t");
}
System.out.println("\n");
}
}
}
public static void main(String args[]){
NumPlacing num=new NumPlacing();
num.done();
}
}
| Is This Answer Correct ? | 8 Yes | 2 No |
Post New Answer View All Answers
What is the role of the java.rmi.naming class?
how to handle exceptions in ejb?
How do you check if a string is lexicographically in java?
What does you mean in math?
What type of variable is gender?
What are static methods?
Write a program to find the greatest of three numbers in java?
Write a function to find out longest palindrome in a given string?
Can we define package statement after import statement in java?
Why are lists ordered in java?
Is null a keyword in java?
What is object in java?
What do you mean by ordered and sorted in collections in java?
How does linkedhashmap work in java?
What is binary search in java?