From 81a91f1979607aeeba58a3cd2c3e8c14c42ce955 Mon Sep 17 00:00:00 2001 From: akash-ranjan8 Date: Fri, 11 Oct 2019 02:30:00 +0530 Subject: [PATCH 1/2] modified the C++ --- C++/binary_search_recursive.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 C++/binary_search_recursive.cpp diff --git a/C++/binary_search_recursive.cpp b/C++/binary_search_recursive.cpp new file mode 100644 index 000000000..0a509c1fa --- /dev/null +++ b/C++/binary_search_recursive.cpp @@ -0,0 +1,33 @@ +#include +using namespace std; +int binary_search(int a[],int lb,int ub,int ele) +{ int mid; + if(lb>n; + int a[n]; + cout<<"enter the array elements\n"; + for(i=0;i>a[i];} + cout<<"enter the element to be searched\n"; + cin>>k; + int z=binary_search(a,0,n-1,k); + cout< Date: Fri, 11 Oct 2019 02:40:31 +0530 Subject: [PATCH 2/2] modified the C --- C/sumdigit.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 C/sumdigit.c diff --git a/C/sumdigit.c b/C/sumdigit.c new file mode 100644 index 000000000..46dd24549 --- /dev/null +++ b/C/sumdigit.c @@ -0,0 +1,14 @@ +#include +void main() +{ int num,sum,digit; + sum=0; + printf("enter the number\n"); + scanf("%d",&num); + while(num!=0) + { digit=num%10; + sum=sum+digit; + num=num/10; + } + printf("the sum of the number digit is%d\n",sum); +} +