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

E/12/061 #41

Open
wants to merge 6 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
2 changes: 1 addition & 1 deletion corrupt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
16 changes: 11 additions & 5 deletions min.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* Problem : If Then Else
*/

#include <stdio.h>

/**
* Find the minimum vlue from a given integer array
* @param int* A pointeer to an integer array
Expand All @@ -11,14 +13,18 @@
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)
int currmin = Array[0];
int i =1;
for ( i=1; i<n; i++)
if (Array[i] < currmin)
currmin = Array[i];
return currmin;

}


int main(){
int arry[]={2,5,7,1,4};
printf("%d\n",getMin(arry,5));
return 0;
}

6 changes: 3 additions & 3 deletions numbers.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* Problem : Point of Origin
*/
#include <stdio.h>

//
/**
* I want to print some numbers
* Can U fxi mE?
*/
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;
}
11 changes: 8 additions & 3 deletions theta.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@
* Am I making a mistake? You tell me.
*/


#include <stdlib.h>

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;
}