Learn C++ Language from the Best Tutors
Search in
To perform division in C++, you can use the division operator (/).
The syntax is:
int quotient = dividend / divisor;
where dividend and divisor are the two numbers you want to divide. The quotient is the result of the division.
For example, to divide 10 by 2, you would use the following code:
int quotient = 10 / 2;
The quotient would be 5.
You can also use division to divide floating-point numbers. To do this, you need to use the floating-point division operator (/.).
The syntax is:
double quotient = dividend / divisor;
where dividend and divisor are the two numbers you want to divide. The quotient is the result of the division.
For example, to divide 10.0 by 2.0, you would use the following code:
double quotient = 10.0 / 2.0;
The quotient would be 5.0.
View 1 more Answers
Related Questions
What is the main difference between returning value of a function and does not return any value of a function in C. Which is correct void main(void), int main(void), int main(int) , or void main(int) and explain the main difference between int main() and int main(void).
Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com
Ask a QuestionRecommended Articles
About C++ Programming Language
Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...
Make a Career as a BPO Professional
Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...
Make a Career in Mobile Application Programming
Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...
Top 5 Skills Every Software Developer Must have
Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today. In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...
Looking for C++ Language Classes?
Learn from the Best Tutors on UrbanPro
Are you a Tutor or Training Institute?
Join UrbanPro Today to find students near youThe best tutors for C++ Language Classes are on UrbanPro
The best Tutors for C++ Language Classes are on UrbanPro