answersLogoWhite

0


Best Answer

Basic code in C++ for division would be:

int a = 2;

int b = 2;

int c = a / b;

A more advanced application would be to allow the user to specify the variables:

#include <iostream>

int num1;

int num2;

std::cout << "What is the first number?";

std::cin >> num1;

std::cout << "What is the second number?";

std::cin >> num2;

std::cout << num1 / num2 << endl;

This program will not account for variables which are entered other than integers.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you divide 2 numbers using c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can anyone fill in the missing divide plus minus multiply signs between the numbers 9 2 3 7 to get an answer of 10?

no-not using numbers in that order


Rational numbers between plus 2 and plus 3?

There are an infinite number of numbers between any two numbers. It is very easy to prove, add 2+3 and divide it by 2, you would get 5/2, right? Now you can add 2 + 5/2 and divide it by 2, and 5/2 + 3 and divide it by 2. And so on, and so forth.


How do you get twenty-three using the numbers 2 9 0 and 0 with the operations plus minus times divide power square root and factorial?

(9-22)2-(0!+0!) Do you have to use all the operations? because this one doesn't have multiply, divide, or root.


How do you get 29 from 1 2 3 4 using plus - x divide?

How about 32 + 1 - 4 ?


How do you divide three digit numbers?

You divide them the same way that you would using 1 or 2 numbers. It is just diving 3 numbers into a number instead of just using 1 or 2. It is that simple. It is just annoying having to manually doit though. I use a calculator now that I am out of school. Good luck.


How can you find the mean a question?

You can find the mean by adding the numbers and dividing that number by how many numbers their is. For example 2 plus 5 plus 2 equals 9 and because there is the three numbers 2 5 and 9 you divide 9 by 3 and get 3 as an answer. This an a example as to how you find the mean.


What number is halfway between 300 and 600?

Add the two numbers, and divide the result by 2.Add the two numbers, and divide the result by 2.Add the two numbers, and divide the result by 2.Add the two numbers, and divide the result by 2.


How do you find a mean?

To find the mean of numbers, add all of the numbers together and then divide them by the number of numbers there are. For example if I want to find the mean of 1, 2, and 3. 1+2+3= 6 and there are 3 numbers that I am using to find the mean (1, 2, and 3). So I divide 6 by 3 and get 2 which is the mean.


How do you 2 digit divide?

you right the numbers and divide


What are two numbers that equal 136?

Two numbers that equal 136 are 136/1 and 0.007352941.


How do you make 100 using numbers 1 2 3 4 5 6 7 8 9 as individual numbers?

1 plus 2 plus 3 plus 4 plus 5 plus 6 plus 7 plus 8 times 9=100


What is the definition of mean mathamatically?

Mean is the average of a set of numbers. First you add all the numbers together, then you divide the answer of that by the amount of numbers you added. example: while using the numbers 1,2,3 1+2+3= 6 then you take 3 and divide it by 6