Motivation Initially code was reusable by encapsulating it within functions Example Write void swap (int& first, int& second) int temp= firsti first second second =temp; Then call swap(x,y);Motivation ▪ Initially code was reusable by encapsulating it within functions ▪ Example: • Write • Then call swap(x,y); void swap (int& first, int& second) { int temp = first; first = second; second = temp; }