which lines of the following code contain errors?

```
 1    int main()
 2    {
 3        const int* i = int();
 4        int const* j = int();
 5        int* const k = int();
 6        int* l();
 7    
 8        ++i;
 9        ++j;
10        ++k;
11        ++*k;
12        ++l;
13    }

```
the compiler will throw the following errors:  


10: error: increment of read-only variable **k**,  


12: error: **lvalue** required as increment operand.
for your insertion and bubble sort, you are returning the comparison value, but you are not assinging it to anything when that value is returned. In your main



```
insertionSort(copy_integers_1);
```

Change that to:



```
int compInsertion = 0;
...
compInsertion = insertionSort(copy_integers_1);
```

and do the same with your bubble sort.



It actually would work the way it is, but the second time you call your functions (in your cout statements in main) the arrays are already sorted.



As for your error, try this



```
int *L = new int[Left_Size];
int *R = new int[Right_Size];
```

Also, you probably don't need to declare Left\_Size or Right\_Size as const. `for i in count:` means `for i in 7:`, which won't work. The bit after the `in` should be of an iterable type, not a number. Try this:



```
for i in range(count):

``` a - ii, b - iv, c - i, d - iii ```
[b]#include[/b] <stdio.h> 

[b]void[/b] [b]foo[/b]([b]int[/b] n)
{
   [b]if[/b] ( n >= 0 )
   {
	  [b]printf[/b]("%d ", n);
	  [b]foo[/b](n - 1);
   }
}

[b]void bar[/b]([b]int[/b] n)
{
   [b]if[/b] ( n >= 0 )
   {
	  [b]bar[/b](n - 1);
	  [b]printf[/b]("%d ", n);
   }
}

[b]int main[/b]() 
{
   [b]int[/b] value = 5;
   [b]foo[/b](value); [b]putchar[/b]('\n');
   [b]bar[/b](value); [b]putchar[/b]('\n');
   [b]return[/b] 0; 
}

/* my output
5 4 3 2 1 0 
0 1 2 3 4 5 
*/
``` [image] wbriggs90:

for (int i = 0; i <= num\_leds; i++) {

this writes num\_leds+1 pixels, probably not what you wanted.

as the index starts with 0, the highest correct index would be num\_leds-1, not num\_leds. What problem are you facing? Post the error that you get.  

Also please edit your first post by aligning the code properly and wrap [code] tag so that it is easily understandable for us to analyze. answer: 15
solution: there are six straight lines `l\_(1),l\_(2),l\_(3),l\_(4),l\_(5),l\_(6)` in a plane.   
 since no two lines are parallel and no three of which pass through the same point, we have maximum points of intersection.   
 line `l\_(1)` intersect five lines, so there will be five points of intersection.   
 similarly, for each of the lines `l\_(2),l\_(3),l\_(4),l\_(5),l\_(6)`, there will be five points of intersection.   
 but there will be double counting .   
 so, total number of points of intersection is `(5xx6)/(2)=15` c = input()  

t = len(c)  

temp = ""  

for i in range(0,len(c)):  

    if t<3:  

        break  

    else:  

        if i in (0,1,t-2,t-1):  

            temp = temp+c[i]  

        else:  

            continue  

print(temp) can you list the things that go wrong and how they should look? Here, this should do it. I just replaced the

 
```
System.out.println(isPrime(n));

```
 part, which would print true or false, with an if

 
```
if (isPrime(n))
    System.out.println("The number is prime.\n");
else 
    System.out.println("The number is not prime.\n");

```
 Here's the code:

 
```
import java.util.Scanner;
public class PrimeNumber{
    public static void main(String args[]){
        int n;
        Scanner Prime = new Scanner(System.in);
        System.out.println(" Please enter a number: ");
        n = Prime.nextInt();
        if (isPrime(n))
            System.out.println("The number is prime.\n");
        else 
            System.out.println("The number is not prime.\n");
    }

    static boolean isPrime(int n) {
        if (n%2==0)return false;
        for(int i=3;i*i<=n;i+=2) {
            if(n%i==0)
                return false;
        }
        return true;
    }
} 

```
 This is a trivial task. You should probably read your coursebook/tutorials, I bet you'll find the answers there.