Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

gcd of two number in c++ stl

// CPP program to illustrate
// gcd function of C++ STL
#include <iostream>
#include <algorithm>
// #include<numeric> for C++17
 
using namespace std;
 
int main()
{
    cout << "gcd(6, 20) = " << __gcd(6, 20) << endl; // gcd(2.0,8) for C++17
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #gcd #number #stl
ADD COMMENT
Topic
Name
6+6 =