Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E12117 Fixed the bugs #58

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions comments.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
@Fawzan : I'm carazy. :D

@Avindu : I'm Late. :(

@Avindu : Finished the Lab 01
3 changes: 2 additions & 1 deletion contributers.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Mohammed Fawzan, The Architect
Mohammed Fawzan, The Architect
E/12/117 : Hendawitharana, A.D.
4 changes: 3 additions & 1 deletion corrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ int main(){


int i;
char string[42] = "Brace your self, CO328 project is coming!!";
// Required enough space for the string to store
char string[43] = "Brace your self, CO328 project is coming!!";
int j;
//printf("%s", string);

return 0;
}
7 changes: 6 additions & 1 deletion min.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
* @param int* A pointeer to an integer array
* @param int n number of elements in the array
*/
#define MAXINT 100000000
int getMin(int *Array, int n) {

//this is a useless comment
int currmin = MAXINT;

for (int i=0; i<n; i++)
if (Array[i] > currmin)
/*Done the mistake here
* Array[i] > currmin has been corrected to
* Array[i] < currmin
*/
if (Array[i] < currmin)
currmin = Array[i];
return currmin;

Expand Down
10 changes: 7 additions & 3 deletions numbers.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@
int main(){

int x;
for(x=43; x<12423; x++);
printf('x = %d \n', x);

for(x=43; x<12423; x++){
/* This is the place where mistake was.
* You must use "" for string inside printf and scanf
* not '' s
*/
printf("x = %d \n", x);
}
return 0;
}
1 change: 1 addition & 0 deletions theta.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ char * giveMeSomeMemory ( int size ){
char * str ;
if (size > 0)
str =( char *) malloc ( size );
str =( char *) malloc ( sizeof(char)* size );
if (size == 1)
return NULL ;
return ( str );
Expand Down