Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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.

Answers were Sorted based on User's Feedback



Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A co..

Answer / 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

Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A co..

Answer / 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

Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A co..

Answer / rupesh

package com.ab.Demo;

public class demo
{
public static void main(String[] args)
{
for (int i=1;i<=100;i++ )
{
if (i%26==0)
{
System.out.print(i+"\t");
System.out.println("");
}
else
{
System.out.print(i+"\t");
}

}

}
}

Is This Answer Correct ?    0 Yes 0 No

Scenario: There are 1 to 100 numbers. Each number should be keep in the each column like from A co..

Answer / badrinath

int var=0,n=100/26;
for(int j=0;j<=n;j++){
for(int i=0;i<26;i++)
{ var=var+1;
if(var>100)
break;
System.out.print(var+"/");

}
System.out.println(); }

}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?

7 Answers   NIIT, Wipro,


How to send a request to garbage collector?

4 Answers  


Can we use string in switch case in java?

0 Answers  


Can a constructor be made final?

0 Answers  


what is object slice?

2 Answers   HTC, TCS,


Explain numeric promotion?

0 Answers  


How many threads can java run?

0 Answers  


String Reverse in Java...!

5 Answers  


Where is core java used?

0 Answers  


What is subsequence of a string?

0 Answers  


What is sortedset in java?

0 Answers  


What are voids?

0 Answers  


Categories