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
Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number
details description on this mantis? who is founder of this mantis?
What's the difference b/w Table & Templete in Smartform?
Busy waiting is a method whereas a taskwaits for a given event by continiously checking for an event to occur. What is the main problem with this approach
When we use Windows authentication mode
hi this is uday i want prepare for nic exam if any one have previous question papers please send me or atlest guide me how to prepare my ID is udaykiran4u@in.com
Write a program to swap the content of two variables without using a third variable.
Which CRM is better to opt, Sebiel CRM or Salesforce CRM or sap CRM? which institute is best one in hyderabad
what are the missinschema properties and should we pass primary key in select command
Difference between delegates and Events?
What is autocall macro and how to create autocall macro? what is the use of it?
How to print No.of.rows affected after updation using ADO.Net
I am looking for selenium RC online Training in chennai. can any one tell me the best institute
Where do we need Operator overloading?
what are other resources are needed for this mantis?