From 29ee5462a35543a79aab6621627ec45457db876f Mon Sep 17 00:00:00 2001 From: WongChinWee <93850449+WongChinWee@users.noreply.github.com> Date: Tue, 31 May 2022 02:27:41 +0800 Subject: [PATCH] Update exercise1.c //documentation section /* Exercise 1 */ //pre-processor section #include //global variable section //main function section int main(){ //write here your program int n,i,a,low,high,mid; printf("Enter the number of elements: "); scanf("%d",&n); int array[n]; printf("Enter the elements in a sorted manner:\n"); for(i=0;ihigh) printf("%d is not present in the array.",a); return 0; } //user-defined section --- exercise1.c | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/exercise1.c b/exercise1.c index d176005..7765a16 100644 --- a/exercise1.c +++ b/exercise1.c @@ -1,5 +1,5 @@ //documentation section -/* Exercise 1 - Sequential Search - Unsorted List*/ +/* Exercise 1 */ //pre-processor section #include @@ -10,8 +10,35 @@ //main function section int main(){ //write here your program - + int n,i,a,low,high,mid; + printf("Enter the number of elements: "); + scanf("%d",&n); + int array[n]; + printf("Enter the elements in a sorted manner:\n"); + for(i=0;ihigh) + printf("%d is not present in the array.",a); + return 0; } -//user-defined section +//user-defined section