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...

Programs in JAVA to get the remainder and quotient of given two numbers without using % and / operators?

Answer Posted / swap1710

import java.util.*;
class Rem
{
public static void main(String args[])
{
double f,qu,remi;
int i,qu1;
Scanner s= new Scanner(System.in);
System.out.println("Enter No..");
f=s.nextFloat();
qu=f*0.1;
qu1=(int)qu;
remi=(qu-qu1)*10;
System.out.println("quotient=" +qu1);
System.out.println("Reminder="+(int)remi);
System.out.println(qu1+"*10" + "+" +(int)remi+"="+(int)f);
}
}

/*
Output:


D:Javap>java Rem
Enter No..
45
quotient=4
Reminder=5
4*10+5=45
*/

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hi All, Can any one please send me the difference between informatica 7i and 8i versions, Thanks in advance. vinod

2037


iam confused among testing ,.net and java. can anybody help me.

2073


sample and simple coding where we get?

2349


hi This is radhika.Can anyone help me to know the question papers of NATIONAL INFORMATICS CENTRE for the post of scientific officer/engineer? if anyone know plz tell me question paper pattern

2146


Diffrence between 2.0,3.0,3.5,4.0. versions of .net?

3203


Hello...has anyone interviewed with Information Management Services(IMS)located in Silver Spring MD??If yes,what can you share about the programming test and the analytical test?

2028


what is the diff bw sql direct and jdbc update can't we do select and updating operation in sql direct

2215


In JCl , we have COND parameter.This holds comparison code and condition.It also has only and even parameters. ex: COND((4,GE),EVEN).what the comma mean here. is that 'and' or 'or'.

2329


what is diff bet ref variable & instance of class

2053


When we have two versions of the dot net installed how does the compiler know which version of DLL it has to select to an application.

1964


hai i am prasanna.I am MCA 2009 fresher.tell me about certifications.which certification helps me to improve my carrier and to get a technically oriented job ,which certification helps to get job faster.

2453


What r the attributes using in Win Runner?

2478


As per interoperatbility programs written in one language can be used by other language. How can we restrict the features of one language (say C#) in the programmer written in another language (say VB)..for example we have some features like operator overloading which is possible C#.NET (not in VB.NET), how can we restrict that when we are using this code in VB.NET.

2007


1. How many jobs can we write in a single file? 2. How many maximum members can exist in a single partition data set(pds) in jcl?

2415


suppose we have ten members of a physical file but we want the output of last 5 members only.how to achieve that?

2130