SlideShare a Scribd company logo
1 of 11
CSE240 Pointers
What is a pointer?
 A type that manipulates aspects of that same type.
 A pointer has the following:
 Location: actual place where the data is stored in memory
 Address: the identifier of the memory location where the data is stored
(i.e. &x == 81300)
 Name: what you call the pointer
 Value: the address of a variable with the same type.
Ex:
int x = 10; // Copy the value of 10 into the address associated with x
// Assume the address of x, denoted as &x, is 81222
int* pointer; // Declare a pointer that works with int variables
pointer = &x; // pointer is assigned the address of x.
// This is the same as pointer = 81222;
Pointer Specification
L-value: an expression that has a location
associated with it. It can appear on the left hand
side or right hand side of an assignment
R-value: an expression that has a value
associated with it but no location associated with
it. It only appears on the right hand side of an
assignment
Ex: int x = 5;
int* a = &x;
*a = 10;
R-value
L-value
Pointer Operations
 Address Operator(&): a unary operator that only applies to l-
values.
It returns the address (r-value) associated with a variable (l-value)
Ex: int x = 100; printf(“%d”, &x); //This prints an address
 Dereference Operator(*): a unary operator that applies to both
l-values and r-values
Applied to an l-value of type T*, it returns an l-value of type T.
Basically, if int* x = &y; then *x == y.
Applied to an r-value of type T, it returns an l-value of type T*.
Ex: int x = 100, y = 20; int* a = &x; int* b = &y;
y = *a; // y = value associated with memory address of x = x
a = *(&b); // a = value associated with memory address of b = b
L-value
R-value
In-Class Exercise 1: Pointer Operations
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)
int main(){
int x = 5, y = 1, z = 3; // Variables of type
int
int* a, *b, *c; // Pointers to int of type int*
a = &x;
b = &y;
b = a;
printf("%d", *b); // Q1
return 0;
}
 Question 1
What value is printed at line Q1?
a) 1
b) 5
c) The address of b
d) The address of a
e) The address of x
f) The address of y
In-Class Exercise 1: Pointer Operations
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)
int main(){
int x = 5, y = 1, z = 3;
int* a, *b, *c;
a = &x; b = &y; c = &z;
*a = *c;
c = b;
*c = 10;
printf("x = %d y = %dn", x, y);
return 0;
}
 Question 2
What value is printed at line Q2?
a) x = 3 y = 10
b) x = 5 y = 1
c) x = 1 y = 3
d) x = 5 y = 10
In-Class Exercise 1: Pointer Operations
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)
int main(){
int x = 5, y = 1, z = 3;
int* a, *b, *c;
a = &x;
b = &y;
c = &z;
a = *(&b);
b = &(*c);
printf("*a = %d *b = %d *c = %dn", *a, *b, *c); // Q3
return 0;
}
 Question 3
What value is printed at line Q3?
a) *a = 1 *b = 3 *c = 3
b) *a = 5 *b = 1 *c = 3
c) *a = 3 *b = 1 *c = 5
d) *a = &b *b = *c *c = 3
In-Class Exercise 1: Pointer Operations
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)
int main(){
int arr[5] = { 0, 1, 2, 3, 4 };
int *a = &arr[4];
while (*a != 0){
printf("%d ", *a);
a--;
}
printf("n"); // Q4
return 0;
}
 Question 4
What value is printed at line Q4?
a) 0 1 2 3 4
b) There is not output
c) Array out of bound exception
d) 4 3 2 1
e) 4 3 2 1 0
In-Class Exercise 1: Pointer Operations
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable: 4996)
int main(){
char arr[3][3] = {
{ '0', '1', '2' },
{ '3', '4', '5' },
{ '6', '7', '0' }
};
char* base = &arr[0][0], *a = &arr[0][0];
a = base + 5;
printf("*a = %c ", *a);
a = base + 3;
printf("row = %s", a); // Q5
return 0;
}
 Question 5
What is the entire output of the
program after Q5 executes?
a) *a = 5 row = 345670
b) *a = 4 row = 345670
c) *a = 5 row = 34567
d) *a = 6 row = 345670
#include <stdio.h>
#include <stdlib.h>
#pragma warning(disable : 4996)
int main() {
int *pointer, i, j, array[6][4];
pointer = malloc(24 * sizeof(int));
for (i = 0; i < 6; i++) {
for (j = 0; j < 4; j++)
*(pointer + (4 * i) + j) = 4 * i + j;
}
printf("%d at %un", *(pointer + 6), pointer + 6);
printf("%d at %un", *(pointer + 7), pointer + 7);
for (i = 0; i < 6; i++) {
for (j = 0; j < 4; j++)
array[i][j] = i * 4 + j;
}
printf("%d at %un", **(array + 5), &array[5][0]);
printf("%d at %un", array[5][1], *(array + 5) + 1);
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
20
21
22
23
0Pointer
Pointer + 6
Pointer + 7
.
.
.
In-Class Exercise 2: Pointer Operations
Self-Testing
1. If line 7 prints “6 at 12000”, what
will line 8 output?
a) 7 at 12001
b) 7 at 12004
c) 7 at 12008
d) 7 at 12024
2. What kind of variable is at the
address array + 5?
a) A pointer to a pointer to an
integer.
b) A pointer to an integer.
c) An integer.
d) A single array of integers.
3. Why does line 14 add 5 in *(array + 5) + 1 to reach
array[5][1]?
a) The target value is 5 bytes away from array.
b) The target value is 20 bytes away from array, and +5
adds 20 bytes.
c) This code is incorrect, it should be *(array + 20) + 4.
d) This code is incorrect, it should be *(array + 20) + 1.
4. If &array[2] is [9984] and &array[3] is [9992], what is
&array[3] – 2?
a) [9984]
b) [9976]
c) [9990]
d) [9992]
5. In line 13, what is the precedence of the ampersand
(&)?
a) &(array[5][0])
b) (&array[5])[0]
c) (&array)[5][0]
d) None of the above

More Related Content

What's hot

USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONvikram mahendra
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribdAmit Kapoor
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionalish sha
 
C tech questions
C tech questionsC tech questions
C tech questionsvijay00791
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONvikram mahendra
 
Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssionseShikshak
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]vikram mahendra
 
detailed information about Pointers in c language
detailed information about Pointers in c languagedetailed information about Pointers in c language
detailed information about Pointers in c languagegourav kottawar
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings imtiazalijoono
 
Module 02 Pointers in C
Module 02 Pointers in CModule 02 Pointers in C
Module 02 Pointers in CTushar B Kute
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++Neeru Mittal
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4Saranya saran
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in cSaranya saran
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointerargusacademy
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9Rumman Ansari
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2Zaibi Gondal
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branchingSaranya saran
 

What's hot (20)

USER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHONUSER DEFINE FUNCTIONS IN PYTHON
USER DEFINE FUNCTIONS IN PYTHON
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribd
 
Dti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpressionDti2143 chapter 3 arithmatic relation-logicalexpression
Dti2143 chapter 3 arithmatic relation-logicalexpression
 
C tech questions
C tech questionsC tech questions
C tech questions
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
 
C Operators
C OperatorsC Operators
C Operators
 
Mesics lecture 4 c operators and experssions
Mesics lecture  4   c operators and experssionsMesics lecture  4   c operators and experssions
Mesics lecture 4 c operators and experssions
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
 
detailed information about Pointers in c language
detailed information about Pointers in c languagedetailed information about Pointers in c language
detailed information about Pointers in c language
 
Programming Fundamentals Arrays and Strings
Programming Fundamentals   Arrays and Strings Programming Fundamentals   Arrays and Strings
Programming Fundamentals Arrays and Strings
 
Module 02 Pointers in C
Module 02 Pointers in CModule 02 Pointers in C
Module 02 Pointers in C
 
Python : Operators
Python : OperatorsPython : Operators
Python : Operators
 
Increment and Decrement operators in C++
Increment and Decrement operators in C++Increment and Decrement operators in C++
Increment and Decrement operators in C++
 
Functions and pointers_unit_4
Functions and pointers_unit_4Functions and pointers_unit_4
Functions and pointers_unit_4
 
Pointers in C
Pointers in CPointers in C
Pointers in C
 
Expressions using operator in c
Expressions using operator in cExpressions using operator in c
Expressions using operator in c
 
C programming pointer
C  programming pointerC  programming pointer
C programming pointer
 
C Programming Language Part 9
C Programming Language Part 9C Programming Language Part 9
C Programming Language Part 9
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
 
Decision making and branching
Decision making and branchingDecision making and branching
Decision making and branching
 

Viewers also liked (12)

Pointers - DataStructures
Pointers - DataStructuresPointers - DataStructures
Pointers - DataStructures
 
C pointer basics
C pointer basicsC pointer basics
C pointer basics
 
C pointer
C pointerC pointer
C pointer
 
C Pointers
C PointersC Pointers
C Pointers
 
Pointer in c program
Pointer in c programPointer in c program
Pointer in c program
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
C programming - Pointers
C programming - PointersC programming - Pointers
C programming - Pointers
 
Pointers in c
Pointers in cPointers in c
Pointers in c
 
Ponters
PontersPonters
Ponters
 
Pointers
PointersPointers
Pointers
 
Pointers in C Programming
Pointers in C ProgrammingPointers in C Programming
Pointers in C Programming
 
C++ Pointers
C++ PointersC++ Pointers
C++ Pointers
 

Similar to CSE240 Pointers

L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxhappycocoman
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxhappycocoman
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptxManojKhadilkar1
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2YOGESH SINGH
 
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...GkhanGirgin3
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...ssuserd6b1fd
 
Function recap
Function recapFunction recap
Function recapalish sha
 
Function recap
Function recapFunction recap
Function recapalish sha
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5alish sha
 
Slide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfSlide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfHimanshuKansal22
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020vrgokila
 
Pointers in C Language
Pointers in C LanguagePointers in C Language
Pointers in C Languagemadan reddy
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1AmIt Prasad
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdfarihantelehyb
 

Similar to CSE240 Pointers (20)

C programming
C programmingC programming
C programming
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptx
 
c programming
c programmingc programming
c programming
 
Chapter5.pptx
Chapter5.pptxChapter5.pptx
Chapter5.pptx
 
Array
ArrayArray
Array
 
Engineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptxEngineering Computers L32-L33-Pointers.pptx
Engineering Computers L32-L33-Pointers.pptx
 
introduction to c programming and C History.pptx
introduction to c programming and C History.pptxintroduction to c programming and C History.pptx
introduction to c programming and C History.pptx
 
VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2VIT351 Software Development VI Unit2
VIT351 Software Development VI Unit2
 
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
booksoncprogramminglanguage-anintroductiontobeginnersbyarunumrao4-21101016591...
 
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
Notes for C Programming for MCA, BCA, B. Tech CSE, ECE and MSC (CS) 4 of 5 by...
 
Function recap
Function recapFunction recap
Function recap
 
Function recap
Function recapFunction recap
Function recap
 
ch08.ppt
ch08.pptch08.ppt
ch08.ppt
 
Dti2143 chapter 5
Dti2143 chapter 5Dti2143 chapter 5
Dti2143 chapter 5
 
Slide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdfSlide set 6 Strings and pointers.pdf
Slide set 6 Strings and pointers.pdf
 
Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020Basic c programs updated on 31.8.2020
Basic c programs updated on 31.8.2020
 
Pointers in C Language
Pointers in C LanguagePointers in C Language
Pointers in C Language
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
(Parent reference for BST) Redefine TreeNode by adding a reference to.pdf
 
Vcs16
Vcs16Vcs16
Vcs16
 

CSE240 Pointers

  • 2. What is a pointer?  A type that manipulates aspects of that same type.  A pointer has the following:  Location: actual place where the data is stored in memory  Address: the identifier of the memory location where the data is stored (i.e. &x == 81300)  Name: what you call the pointer  Value: the address of a variable with the same type. Ex: int x = 10; // Copy the value of 10 into the address associated with x // Assume the address of x, denoted as &x, is 81222 int* pointer; // Declare a pointer that works with int variables pointer = &x; // pointer is assigned the address of x. // This is the same as pointer = 81222;
  • 3. Pointer Specification L-value: an expression that has a location associated with it. It can appear on the left hand side or right hand side of an assignment R-value: an expression that has a value associated with it but no location associated with it. It only appears on the right hand side of an assignment Ex: int x = 5; int* a = &x; *a = 10; R-value L-value
  • 4. Pointer Operations  Address Operator(&): a unary operator that only applies to l- values. It returns the address (r-value) associated with a variable (l-value) Ex: int x = 100; printf(“%d”, &x); //This prints an address  Dereference Operator(*): a unary operator that applies to both l-values and r-values Applied to an l-value of type T*, it returns an l-value of type T. Basically, if int* x = &y; then *x == y. Applied to an r-value of type T, it returns an l-value of type T*. Ex: int x = 100, y = 20; int* a = &x; int* b = &y; y = *a; // y = value associated with memory address of x = x a = *(&b); // a = value associated with memory address of b = b L-value R-value
  • 5. In-Class Exercise 1: Pointer Operations #include <stdio.h> #include <stdlib.h> #pragma warning(disable: 4996) int main(){ int x = 5, y = 1, z = 3; // Variables of type int int* a, *b, *c; // Pointers to int of type int* a = &x; b = &y; b = a; printf("%d", *b); // Q1 return 0; }  Question 1 What value is printed at line Q1? a) 1 b) 5 c) The address of b d) The address of a e) The address of x f) The address of y
  • 6. In-Class Exercise 1: Pointer Operations #include <stdio.h> #include <stdlib.h> #pragma warning(disable: 4996) int main(){ int x = 5, y = 1, z = 3; int* a, *b, *c; a = &x; b = &y; c = &z; *a = *c; c = b; *c = 10; printf("x = %d y = %dn", x, y); return 0; }  Question 2 What value is printed at line Q2? a) x = 3 y = 10 b) x = 5 y = 1 c) x = 1 y = 3 d) x = 5 y = 10
  • 7. In-Class Exercise 1: Pointer Operations #include <stdio.h> #include <stdlib.h> #pragma warning(disable: 4996) int main(){ int x = 5, y = 1, z = 3; int* a, *b, *c; a = &x; b = &y; c = &z; a = *(&b); b = &(*c); printf("*a = %d *b = %d *c = %dn", *a, *b, *c); // Q3 return 0; }  Question 3 What value is printed at line Q3? a) *a = 1 *b = 3 *c = 3 b) *a = 5 *b = 1 *c = 3 c) *a = 3 *b = 1 *c = 5 d) *a = &b *b = *c *c = 3
  • 8. In-Class Exercise 1: Pointer Operations #include <stdio.h> #include <stdlib.h> #pragma warning(disable: 4996) int main(){ int arr[5] = { 0, 1, 2, 3, 4 }; int *a = &arr[4]; while (*a != 0){ printf("%d ", *a); a--; } printf("n"); // Q4 return 0; }  Question 4 What value is printed at line Q4? a) 0 1 2 3 4 b) There is not output c) Array out of bound exception d) 4 3 2 1 e) 4 3 2 1 0
  • 9. In-Class Exercise 1: Pointer Operations #include <stdio.h> #include <stdlib.h> #pragma warning(disable: 4996) int main(){ char arr[3][3] = { { '0', '1', '2' }, { '3', '4', '5' }, { '6', '7', '0' } }; char* base = &arr[0][0], *a = &arr[0][0]; a = base + 5; printf("*a = %c ", *a); a = base + 3; printf("row = %s", a); // Q5 return 0; }  Question 5 What is the entire output of the program after Q5 executes? a) *a = 5 row = 345670 b) *a = 4 row = 345670 c) *a = 5 row = 34567 d) *a = 6 row = 345670
  • 10. #include <stdio.h> #include <stdlib.h> #pragma warning(disable : 4996) int main() { int *pointer, i, j, array[6][4]; pointer = malloc(24 * sizeof(int)); for (i = 0; i < 6; i++) { for (j = 0; j < 4; j++) *(pointer + (4 * i) + j) = 4 * i + j; } printf("%d at %un", *(pointer + 6), pointer + 6); printf("%d at %un", *(pointer + 7), pointer + 7); for (i = 0; i < 6; i++) { for (j = 0; j < 4; j++) array[i][j] = i * 4 + j; } printf("%d at %un", **(array + 5), &array[5][0]); printf("%d at %un", array[5][1], *(array + 5) + 1); return 0; } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 20 21 22 23 0Pointer Pointer + 6 Pointer + 7 . . . In-Class Exercise 2: Pointer Operations
  • 11. Self-Testing 1. If line 7 prints “6 at 12000”, what will line 8 output? a) 7 at 12001 b) 7 at 12004 c) 7 at 12008 d) 7 at 12024 2. What kind of variable is at the address array + 5? a) A pointer to a pointer to an integer. b) A pointer to an integer. c) An integer. d) A single array of integers. 3. Why does line 14 add 5 in *(array + 5) + 1 to reach array[5][1]? a) The target value is 5 bytes away from array. b) The target value is 20 bytes away from array, and +5 adds 20 bytes. c) This code is incorrect, it should be *(array + 20) + 4. d) This code is incorrect, it should be *(array + 20) + 1. 4. If &array[2] is [9984] and &array[3] is [9992], what is &array[3] – 2? a) [9984] b) [9976] c) [9990] d) [9992] 5. In line 13, what is the precedence of the ampersand (&)? a) &(array[5][0]) b) (&array[5])[0] c) (&array)[5][0] d) None of the above

Editor's Notes

  1. Answer: b
  2. Answer: a
  3. Answer: a
  4. Answer: d
  5. Answer: c
  6. Answers: 1.) b 2.) a 3.) b 4.) b 5.) a