how to find hcf in c++
C++
// C++ program to find GCD of two numbers
#include <iostream>
using namespace std;
// Recursive function to return gcd of a and b
int gcd(int a, int b)
{
if (b == 0)
return a;
return gcd(b, a % b);
}
// Driver program to test above function
int main()
{
int a = 98, b = 56;
cout<<"GCD of "<<a<<" and "<<b<<" is "<<gcd(a, b);
return 0;
}
Also in C++:
- Title
- error: redefinition of ‘class Customer’
- Category
- C++
- Title
- maximum possible number atmost k swaps
- Category
- C++
- Title
- error: invalid use of template-name without an argument list
- Category
- C++
- Title
- stl sort in c++
- Category
- C++
- Title
- get index of value c++
- Category
- C++
- Title
- accept the noun and the output of plural c++
- Category
- C++
- Title
- Combination Sum
- Category
- C++
- Title
- c++ how to make a negative float positive
- Category
- C++
- Title
- matrix multiplication c++ eigen
- Category
- C++
- Title
- date to string c++
- Category
- C++
- Title
- find upper bound c++ vector
- Category
- C++
- Title
- heredar constructor c++
- Category
- C++
- Title
- how to reverse a vector
- Category
- C++
- Title
- hashmap in c++
- Category
- C++
- Title
- gfg bottom view of tree
- Category
- C++
- Title
- c++ sort
- Category
- C++
- Title
- find in string c++
- Category
- C++
- Title
- Runtime Error: Runtime ErrorFloating-point exception (SIGFPE
- Category
- C++
- Title
- C++ and endl
- Category
- C++
- Title
- compile c++ program
- Category
- C++
- Title
- how to extract substring from string in c++
- Category
- C++
- Title
- can we compare a long long int with int in c++ using max or min functions
- Category
- C++
- Title
- declaring vector c++
- Category
- C++
- Title
- tuple c++
- Category
- C++
- Title
- c++ allocate dynamic with initial values
- Category
- C++
- Title
- how to end a c++ program early
- Category
- C++
- Title
- how to sort a vector in c++
- Category
- C++
- Title
- pow c++
- Category
- C++
- Title
- adding element in vector c++
- Category
- C++
- Title
- Operator overloading in C++ Programming
- Category
- C++
- Title
- how to find the mode of a vector c++
- Category
- C++
- Title
- how to find the size of a character array in c++
- Category
- C++
- Title
- create new file c++
- Category
- C++
- Title
- c++ looping through a vector
- Category
- C++
- Title
- inconsequential meaning
- Category
- C++
- Title
- caesar cipher program in c++
- Category
- C++
- Title
- find all the palindrome substring in a given string
- Category
- C++
- Title
- typeid to string c++
- Category
- C++
- Title
- popualte an array c++
- Category
- C++
- Title
- c++ declare char
- Category
- C++
- Title
- how to get a letter from the users string in c++
- Category
- C++
- Title
- char* to int in cpp
- Category
- C++
- Title
- how to switch to another branch in git
- Category
- C++
- Title
- maximum subarray sum equal with K in c++
- Category
- C++
- Title
- use of strstr in c++
- Category
- C++
- Title
- min heap priority queue c++
- Category
- C++
- Title
- c++ give options
- Category
- C++
- Title
- c++ overload operator
- Category
- C++
- Title
- array 2d to 1d
- Category
- C++
- Title
- how to print to the serial monitor arduino
- Category
- C++
- Title
- how to append an element to an array in cpp
- Category
- C++
- Title
- c++ constructor
- Category
- C++
- Title
- how to find the number of cycles in a graph C++
- Category
- C++
- Title
- bellman ford algorithm cp algorithm
- Category
- C++
- Title
- c++ typeid get type name
- Category
- C++
- Title
- ue4 c++ struct
- Category
- C++
- Title
- check an stack is empty c++
- Category
- C++
- Title
- delete 2d dynamic array c++
- Category
- C++
- Title
- c++ how to skip the last element of vector
- Category
- C++
- Title
- cpp loop through object
- Category
- C++
- Title
- log base e synthax c++
- Category
- C++
- Title
- graph using djacency matrix c++
- Category
- C++
- Title
- apple and orange hackerrank solution in c++
- Category
- C++
- Title
- index string c++
- Category
- C++
- Title
- access last element in vector in c++
- Category
- C++
- Title
- c++ switch case statement
- Category
- C++
- Title
- sqrt cpp
- Category
- C++
- Title
- C++ Syntax
- Category
- C++
- Title
- msdn parse command line
- Category
- C++
- Title
- pass by reference c++
- Category
- C++
- Title
- c++ string to integer without stoi
- Category
- C++
- Title
- extends c++
- Category
- C++
- Title
- switch case sinax c++
- Category
- C++
- Title
- c++ crash windows
- Category
- C++
- Title
- traverse a map
- Category
- C++
- Title
- Shortest Distance in a Maze
- Category
- C++
- Title
- random number in c++
- Category
- C++
- Title
- c++ char to string
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- rgb(100,100,100,0.5) validation c++
- Category
- C++
- Title
- Merge k sorted linked lists and return it as one sorted list.
- Category
- C++
- Title
- setbits
- Category
- C++
- Title
- how to take input in C++ in coding
- Category
- C++
- Title
- how to avoid tle in c++
- Category
- C++
- Title
- foind th output c++
- Category
- C++
- Title
- string to upper c++
- Category
- C++
- Title
- 1d fixed length arrays c++
- Category
- C++
- Title
- cout value c++
- Category
- C++
- Title
- constant variables in c++
- Category
- C++
- Title
- roscpp publish int32
- Category
- C++
- Title
- c++ program to find gcd of 3 numbers
- Category
- C++
- Title
- count function c++
- Category
- C++
- Title
- C++ while
- Category
- C++
- Title
- arduino falling edge
- Category
- C++
- Title
- log base 10 c+_+
- Category
- C++
- Title
- basic ex of maps in c++
- Category
- C++
- Title
- container class in c++
- Category
- C++
- Title
- c++ remove item from list
- Category
- C++
- Title
- COnvert string to char * C++
- Category
- C++
- Title
- nan c++ example
- Category
- C++