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 access modifiers can be used for class ?
Explain what are final variable in java?
How do you create a bulleted list?
What is OOP's Terms with explanation?
How does arraylist size increase in java?
What two classes are used to read data only?
When do we use synchronized blocks and advantages of using synchronized blocks?
Are strings immutable in java?
How do you create a reference in java?
What is the use of accept () method in java?
what is the major difference between linkedlist and arraylist in java?
how are methods defined?
What is entry set in java?
design an lru cache in java?
What is an immutable class?