Write a program which prints all factors of the number \(N\). The code which prints the factors should be placed inside a function. Print an additional message to the console if \(N\) is a prime number.
Modify the program in such a way that it prints all prime numbers inside the range \(\{1,\ldots,\mathrm{M}\}\). Modify the function which prints factors so that it only returns information whether a number is prime or not.
Write a program to see how you can use pointers and arrays:
d,d with 10,p,p with the address of the variable
d (p points to d),d and the value which is pointed to
by p (use operator *),d to 20,d and the value which is pointed to
by p,p,d and the value which is pointed to
by p,d and the value of the pointer
p (remember that the pointer stores the address, use the
printf function, e.g.:
printf("%p", &d);)tab of integers with two elements
(int tab[2];)333 and
444,p the address of the array
tab,| Address of variable | Name of the variable | Value of the variable |
|---|---|---|
| %p | d | %d |
| %p | p | %p |
| %p | p[0] | %d |
| %p | t | %p |
| %p | t[0] | %d |
| %p | t[1] | %d |
tab