From fe947f2f6b1267da0f31b9fd8c6c1286e4b4dd61 Mon Sep 17 00:00:00 2001
From: Md Ansar Hussain <91614411+MdAnsar7@users.noreply.github.com>
Date: Sat, 19 Oct 2024 18:18:30 +0530
Subject: [PATCH] Create quadratic_equation.cpp

---
 C++/quadratic_equation.cpp | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 C++/quadratic_equation.cpp

diff --git a/C++/quadratic_equation.cpp b/C++/quadratic_equation.cpp
new file mode 100644
index 0000000..ef575e1
--- /dev/null
+++ b/C++/quadratic_equation.cpp
@@ -0,0 +1,25 @@
+#include <iostream>
+using namespace std;
+
+int main() {
+  int n1, n2, hcf;
+  cout << "Enter two numbers: ";
+  cin >> n1 >> n2;
+
+  // swapping variables n1 and n2 if n2 is greater than n1.
+  if ( n2 > n1) {   
+    int temp = n2;
+    n2 = n1;
+    n1 = temp;
+  }
+    
+  for (int i = 1; i <=  n2; ++i) {
+    if (n1 % i == 0 && n2 % i ==0) {
+      hcf = i;
+    }
+  }
+
+  cout << "HCF = " << hcf;
+
+  return 0;
+}