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


Please Help Members By Posting Answers For Below Questions

Compare java and python.

581


how to split string in java?

656


What is java util list?

489


Which class is the superclass for all the classes?

535


What is main in java?

513






What is an interface in java? Explain

578


What does localhost mean?

502


What is logical variable?

514


Does it matter in what order catch statements for filenotfoundexception and ioexception are written?

506


Is namespace same as package in java?

545


What is use of a abstract variable?

543


Can we declare a class as abstract without having any abstract method?

557


What all methods are used to prevent thread execution ?

558


What is a function argument in java?

520


What is the difference between path and classpath variables?

531