Assignment #1 Program the following functions in C


1) the following function which copies string s to string t using character array: the main program will be given at the lab

void strcpy(char s[], char t[])

 

2) the following function which copies string s to string t using pointers: the main program will be given at the lab.

 

void strcpy(char *s, char *t)

 

3) Modify the following function using recursive call (float sumRecursive(int, float*)). The main program will be given at the lab.

 

float  sumNonRecursive(int N, float values[]) {

int i;

float result=0;

for(i=0;i<N;i++) result=result+values[i];

return result;

}

 

The oral test will take place at the lab. on March 08.

*3/8 updated : The program which only contains main code is below.

[ppt, main]

* 3/9 updated : [solution]