From 53db45dcaedf1fa7daf006aa042845e091277018 Mon Sep 17 00:00:00 2001 From: Babirye-Lydia <38240581+Babirye-Lydia@users.noreply.github.com> Date: Thu, 12 Apr 2018 19:24:30 +0300 Subject: [PATCH 1/6] Create Question one --- Question one | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Question one diff --git a/Question one b/Question one new file mode 100644 index 00000000..606b7f97 --- /dev/null +++ b/Question one @@ -0,0 +1,15 @@ +#include d +int x=1; +main() +{ + + if(x==1) +printf("x equals 1"); + else +{ + printf("x does not equal 1"); +} + + + return 0; +} From 9f6450abd8ed1303d1ce2c894d6fe433548d1e74 Mon Sep 17 00:00:00 2001 From: Babirye-Lydia <38240581+Babirye-Lydia@users.noreply.github.com> Date: Thu, 12 Apr 2018 19:27:34 +0300 Subject: [PATCH 2/6] Create Question 1 --- Question 1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Question 1 diff --git a/Question 1 b/Question 1 new file mode 100644 index 00000000..d26c2563 --- /dev/null +++ b/Question 1 @@ -0,0 +1,14 @@ +#include d +int x=1; +main() +{ + + if(x==1) +printf("x equals 1"); + else +{ + printf("x does not equal 1"); +} + return 0; +} + From 191376e5a2c46173f17ea77c5c23e5fb7df35ae5 Mon Sep 17 00:00:00 2001 From: Babirye-Lydia <38240581+Babirye-Lydia@users.noreply.github.com> Date: Thu, 12 Apr 2018 19:29:30 +0300 Subject: [PATCH 3/6] Create Question 2 --- Question 2 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Question 2 diff --git a/Question 2 b/Question 2 new file mode 100644 index 00000000..c7fd00a3 --- /dev/null +++ b/Question 2 @@ -0,0 +1,21 @@ +2a float do_it(char A, char B, char C) + +2b void print_a_number(int a) + +2c #include + void print_msg( void ); + main(){ + print_msg("This is a message to print"); + return 0; + } + void print_msq( void ) + { + puts("This is a message to print"); + return 0; + } + +/*The function name in the header file is different from that in the program body that is; print_msg and print_msq are different yet they +are supposed to be the same in a given program.*/ + +/*The function has arguments yet the declaration indicates that the function has no arguments.*/ + From 76deef6387eb436fe9be6abaad966257e51bdbe4 Mon Sep 17 00:00:00 2001 From: Babirye-Lydia <38240581+Babirye-Lydia@users.noreply.github.com> Date: Thu, 12 Apr 2018 19:31:47 +0300 Subject: [PATCH 4/6] Create Question 3 --- Question 3 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Question 3 diff --git a/Question 3 b/Question 3 new file mode 100644 index 00000000..285e197a --- /dev/null +++ b/Question 3 @@ -0,0 +1,20 @@ +3a long a[50]; + +3b a[49]=123.456 + +3c The values of x; 0 to 99 + +3d The values of ctr are; 2,5,8 + +3e + int i=1; + while(i<100) +{ + printf("%d\n",i); + i+=3; +} + + +3f for (counter = 1; counter < MAXVALUES; counter++ );/*The for statement is not supposed to be terminated in C*/ + printf("\nCounter = %d", counter); + From 45f58cf2f4c596ff49519756d9bbb0de6888d785 Mon Sep 17 00:00:00 2001 From: Babirye-Lydia <38240581+Babirye-Lydia@users.noreply.github.com> Date: Thu, 12 Apr 2018 19:34:17 +0300 Subject: [PATCH 5/6] Create Question 4 --- Question 4 | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 Question 4 diff --git a/Question 4 b/Question 4 new file mode 100644 index 00000000..642adba2 --- /dev/null +++ b/Question 4 @@ -0,0 +1,52 @@ +4a +/*void addarrays(int N, int x[],int y[],int z[]){ +int i; +for(i=0; i +#include +int N, i; +int *addarrays(int N,int x[],int y[],int z[]){ +int i; +for(i=0; i Date: Thu, 12 Apr 2018 19:35:17 +0300 Subject: [PATCH 6/6] Delete Question one --- Question one | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 Question one diff --git a/Question one b/Question one deleted file mode 100644 index 606b7f97..00000000 --- a/Question one +++ /dev/null @@ -1,15 +0,0 @@ -#include d -int x=1; -main() -{ - - if(x==1) -printf("x equals 1"); - else -{ - printf("x does not equal 1"); -} - - - return 0; -}