Skip to main content

lldiv() , A function of library lldiv_t in c++

 

lldiv() Return value

The lldiv() function returns a structure of type lldiv_t which consists of two members: quot and rem. It is defined as follows:

struct lldiv_t {
	long long quot;
	long long rem;
};

Example: How lldiv() function works in C++?

#include <iostream>
#include <cstdlib>
using namespace std;

int main()
{
	long long nume = 998102910012LL;
	long long deno = 415LL;
	
	lldiv_t result = lldiv(nume, deno);
	
	cout << "Quotient of " << nume << "/" << deno << " = " << result.quot << endl;
	cout << "Remainder of " << nume << "/" << deno << " = " << result.rem << endl;
	
	return 0;
}

When you run the program, the output will be:

Quotient of 998102910012/415 = 2405067253
Remainder of 998102910012/415 = 17

Comments

Popular posts from this blog

Service install on window system

 If we have to install service make sure,  .interframework install already. Goto folder like:-  C:\Windows\Microsoft.NET\Framework\v2.0.50727  C:\Windows\Microsoft.NET\Framework\ v2.0.50727 (Note: version folder can be change as the version change.) Open command prompt by  writing the "cmd" in the box of file/folder location shoes Run the command : "installUtil.exe pathofexeofthe service"

7 features of OOPs

The 7 features of OOPs are as follows: 1. Incapsulation 2. Abstraction 3. Inheritance 4. Polymorphism 5. Object must be used 6. Massage passing : One object can interect with another object 7. Dynamic binding The most initial 4 are the basic OOPs features that is required.