Write a program that finds the quotients and remainders of all the numbers

between 200 and 225 when they are divided by x, where x= 11 if the number

is even and x is 14 if the number is odd. Here's what the output should

look like.

OUTPUT:

Printable View

- 04-17-2008, 03:19 PMZebraQuotients/Remainders (Loops *Need Help*)
Write a program that finds the quotients and remainders of all the numbers

between 200 and 225 when they are divided by x, where x= 11 if the number

is even and x is 14 if the number is odd. Here's what the output should

look like.

OUTPUT: - 04-17-2008, 03:25 PMsukatoa
You know what?!! if you don't try to do it yourself first, you will never realize how lovable java programming is....

An ideal forum was designed to help/discuss other members about there problem or new ideas, sharing it with them while learning....

And not to feed them ( Posting the complete code )....

don't be on a hurry,

sukatoa - 04-17-2008, 04:08 PMsanjeevtarar
Hello Zebra,

I think your problem is not much hard...just think about the logic and do some paper work, it will help you lot.

First try it at your self...OK

however i have done this.

Code:`public class FindQuotientsRemainders`

{

public static void main(String[] args){

getNumber();

}

public static void getNumber(){

int evenX = 11;

int oddX = 14;

for (int i=200;i<=225;i++ ){

int quoti = 0,rema = 0;

if(i%2==0){

quoti = i/evenX;

rema = i%evenX;

System.out.println("When "+i+" is divided by "+evenX+", the quotients is "+quoti+" and remainders is "+rema);

}else{

quoti = i/oddX;

rema = i%oddX;

System.out.println("When "+i+" is divided by "+oddX+", the quotients is "+quoti+" and remainders is "+rema);

}

}

}

}

sanjeev