From 8bd6630834c6c50b6dbf1e3694933bd45d805860 Mon Sep 17 00:00:00 2001 From: adarsh1498 <44162669+adarsh1498@users.noreply.github.com> Date: Tue, 16 Oct 2018 16:29:47 +0530 Subject: [PATCH 1/4] lcm and gcf program of a given interger --- lcm.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 lcm.cpp diff --git a/lcm.cpp b/lcm.cpp new file mode 100644 index 00000000..ae609340 --- /dev/null +++ b/lcm.cpp @@ -0,0 +1,21 @@ +#include +using namespace std; +int main() +{ + int a, b, x, y, temp, hcf, lcm; + cout<<"\n Enter Two Numbers : \n"; + cin>>x>>y; + a=x; + b=y; + while(b!=0) + { + temp=b; + b=a%b; + a=temp; + } + hcf=a; + lcm=(x*y)/hcf; + cout<<"\n HCF : "< Date: Tue, 16 Oct 2018 16:35:46 +0530 Subject: [PATCH 2/4] program of binary serach in cpp --- search.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 search.cpp diff --git a/search.cpp b/search.cpp new file mode 100644 index 00000000..6ba51bd4 --- /dev/null +++ b/search.cpp @@ -0,0 +1,50 @@ +#include + +using namespace std; + +int main() +{ + int search(int [],int,int); + int n,i,a[100],e,res; + cout<<"How Many Elements:"; + cin>>n; + cout<<"\nEnter Elements of Array in Ascending order\n"; + + for(i=0;i>a[i]; + } + + cout<<"\nEnter element to search:"; + cin>>e; + + res=search(a,n,e); + + if(res!=-1) + cout<<"\nElement found at position "<a[m]) + f=m+1; + else + l=m-1; + } + + return -1; +} From d62e0817e856dc2f1dfa3d61eab1a1e328796310 Mon Sep 17 00:00:00 2001 From: TANIYA GUPTA Date: Mon, 17 Dec 2018 00:02:30 +0530 Subject: [PATCH 3/4] Rename lcm.cpp to SOLUTIONS/lcm.cpp --- lcm.cpp => SOLUTIONS/lcm.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lcm.cpp => SOLUTIONS/lcm.cpp (100%) diff --git a/lcm.cpp b/SOLUTIONS/lcm.cpp similarity index 100% rename from lcm.cpp rename to SOLUTIONS/lcm.cpp From 4530648e92d6c2796cda6ddb92f00c6e176a1179 Mon Sep 17 00:00:00 2001 From: TANIYA GUPTA Date: Mon, 17 Dec 2018 00:02:51 +0530 Subject: [PATCH 4/4] Rename search.cpp to SOLUTIONS/search.cpp --- search.cpp => SOLUTIONS/search.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename search.cpp => SOLUTIONS/search.cpp (100%) diff --git a/search.cpp b/SOLUTIONS/search.cpp similarity index 100% rename from search.cpp rename to SOLUTIONS/search.cpp