From db7ac6aa492229e682bb5cdc93cceca8a8eb604a Mon Sep 17 00:00:00 2001 From: Danoja Dias Date: Tue, 21 Jun 2016 06:13:49 +0530 Subject: [PATCH 1/5] Update numbers.c Changed the errors --- numbers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/numbers.c b/numbers.c index 9d42c01..8e7ce83 100644 --- a/numbers.c +++ b/numbers.c @@ -11,8 +11,8 @@ int main(){ int x; - for(x=43; x<12423; x++); - printf('x = %d \n', x); + for(x=43; x<12423; x++) + printf("x = %d \n", x); return 0; } From 33a2029eb4221a3199d9dbaa30c4cbf10cc94449 Mon Sep 17 00:00:00 2001 From: Danoja Dias Date: Tue, 21 Jun 2016 11:43:02 +0530 Subject: [PATCH 2/5] Number of characters were changed to 43 --- corrupt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/corrupt.c b/corrupt.c index 44618d7..0874389 100644 --- a/corrupt.c +++ b/corrupt.c @@ -15,7 +15,7 @@ int main(){ int i; - char string[42] = "Brace your self, CO328 project is coming!!"; + char string[43] = "Brace your self, CO328 project is coming!!"; int j; return 0; From 495362d0fc4bb990d41354846ae4d329309c8c5a Mon Sep 17 00:00:00 2001 From: Danoja Dias Date: Tue, 21 Jun 2016 11:52:16 +0530 Subject: [PATCH 3/5] Fixed the bug to find minimum value --- min.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/min.c b/min.c index e24e74d..d47a5b8 100644 --- a/min.c +++ b/min.c @@ -3,6 +3,8 @@ * Problem : If Then Else */ +#include + /** * Find the minimum vlue from a given integer array * @param int* A pointeer to an integer array @@ -11,14 +13,18 @@ int getMin(int *Array, int n) { //this is a useless comment - int currmin = MAXINT; - - for (int i=0; i currmin) + int currmin = Array[0]; + int i =1; + for ( i=1; i Date: Tue, 21 Jun 2016 11:54:28 +0530 Subject: [PATCH 4/5] print the numbers --- numbers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/numbers.c b/numbers.c index 8e7ce83..8f390e5 100644 --- a/numbers.c +++ b/numbers.c @@ -3,7 +3,7 @@ * Problem : Point of Origin */ #include - +// /** * I want to print some numbers * Can U fxi mE? From 76c296a84d9188b043ce393ba4386ee8b4e2cccf Mon Sep 17 00:00:00 2001 From: Danoja Dias Date: Tue, 21 Jun 2016 11:55:56 +0530 Subject: [PATCH 5/5] added the header files and changed the malloc --- theta.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/theta.c b/theta.c index d5cd68b..5d5c5ce 100644 --- a/theta.c +++ b/theta.c @@ -8,13 +8,18 @@ * Am I making a mistake? You tell me. */ - +#include char * giveMeSomeMemory ( int size ){ char * str ; if (size > 0) - str =( char *) malloc ( size ); - if (size == 1) + str =( char *) malloc ( size*sizeof(char)); + if (size == 0) return NULL ; return ( str ); } + +int main(){ + +return 0; +}