Skip to content
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
Binary file added charlene/Solutions.pdf
Binary file not shown.
13 changes: 13 additions & 0 deletions question 2
Original file line number Diff line number Diff line change
@@ -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.
13 changes: 13 additions & 0 deletions question 3
Original file line number Diff line number Diff line change
@@ -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<stdio.h>
main(){
if(x==1)
printf("x equals 1")
else
printf("x does not equal 1");
return0;
}
5 changes: 5 additions & 0 deletions question four
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void addarrays(int array1[], int array2[], int destination_array[], int SIZE){
for(int i=0;i<SIZE;++)
destination_array[i]=array1[i]+array2[i];
}
}
9 changes: 9 additions & 0 deletions question one
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <stdio.h>
intx=1;
main()
if(x==1)
printf("x equals 1);
else
printf("x does not equal to 1);
return0;
}
15 changes: 15 additions & 0 deletions question three
Original file line number Diff line number Diff line change
@@ -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 <stdio.h>
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.