diff --git a/charlene/Solutions.pdf b/charlene/Solutions.pdf new file mode 100644 index 00000000..d2d55e33 Binary files /dev/null and b/charlene/Solutions.pdf differ diff --git a/question 2 b/question 2 new file mode 100644 index 00000000..e194aa62 --- /dev/null +++ b/question 2 @@ -0,0 +1,13 @@ +(do_it.h) +#ifndef DO_IT_H +#define DO_IT_H +float do_it(char a, char b, char c); +#endif//DO_IT_H + +(print_a_number.h) +#ifdef PRINT_A_NUMBER_H +#define PRINT_A_NUMBER_H +void print_a_number(int x); +#endif//PRINT_A_NUMBER_H + +The print_msg()function is not supposed to take any arguments but the main function calls it with a string argument. diff --git a/question 3 b/question 3 new file mode 100644 index 00000000..6d0c752a --- /dev/null +++ b/question 3 @@ -0,0 +1,13 @@ +long values[50]; +long values[49]=123456; +x is equalto 100 when the statement is complete +the value of ctr is 11 when the statement is complete + +#include +main(){ + if(x==1) + printf("x equals 1") + else + printf("x does not equal 1"); + return0; + } diff --git a/question four b/question four new file mode 100644 index 00000000..bdb00b36 --- /dev/null +++ b/question four @@ -0,0 +1,5 @@ +void addarrays(int array1[], int array2[], int destination_array[], int SIZE){ +for(int i=0;i +intx=1; +main() + if(x==1) + printf("x equals 1); +else + printf("x does not equal to 1); + return0; +} diff --git a/question three b/question three new file mode 100644 index 00000000..1c558699 --- /dev/null +++ b/question three @@ -0,0 +1,15 @@ +long values[50]; +long values[49]=123456 +x is equal to 100 when the statement is complete +the value of ctr is 11 when the statement is complete + +#include +main(){ +int count=1; +while(count<=100){ + printf("%d",count); + count+=3; + } + } + +the code under the for loop is always executed once ,outside of the for loop, because of the semicolon terminating the for loop.