
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
lldiv() function in C++ STL
lldiv() function in C++ STL gives the result of quotient and remainder of the division of the two numbers.
Algorithm
Begin Take two long type numbers as input. Call function lldiv(). Print the quotient and remainder. End.
Example Code
#include <cstdlib> #include <iostream> using namespace std; int main() { long long q = 500LL; long long r = 25LL; lldiv_t res = lldiv(q, r); cout << "Quotient of " << q << "/" << r << " = " << res.quot << endl; cout << "Remainder of " << r << "/" << r << " = " << res.rem << endl; return 0; }
Output
Quotient of 500/25 = 20 Remainder of 25/25 = 0
- Related Articles
- sinh() function in C++ STL
- cosh() function in C++ STL
- atanh() function in C++ STL
- tanh() function in C++ STL
- acosh() function in C++ STL
- asinh() function in C++ STL
- acos() function in C++ STL
- atan2() function in C++ STL
- iswalnum() function in C++ STL
- iswalpha() function in C++ STL
- negate function in C++ STL
- iswpunct() function in C++ STL
- iswspace() function in C++ STL
- iswupper() function in C++ STL
- iswxdigit() function in C++ STL

Advertisements