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
Compare java and python.
how to split string in java?
What is java util list?
Which class is the superclass for all the classes?
What is main in java?
What is an interface in java? Explain
What does localhost mean?
What is logical variable?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
Is namespace same as package in java?
What is use of a abstract variable?
Can we declare a class as abstract without having any abstract method?
What all methods are used to prevent thread execution ?
What is a function argument in java?
What is the difference between path and classpath variables?