PRIMES AND NUMERAL SYSTEMS a) Prime factorization of the number https://en.wikipedia.org/wiki/Prime_number#Unique_factorization https://pl.wikipedia.org/wiki/Czynnik_pierwszy https://pl.wikipedia.org/wiki/Rozk%C5%82ad_na_czynniki Ex 1) Write a program which will do the prime factorization of the number. Exemplary flow chart can be found at ./primes.gif Explanation for the flow chart can be found in: https://pl.wikipedia.org/wiki/Rozk%C5%82ad_na_czynniki Section "Algorytmy faktoryzacji" and https://pl.wikipedia.org/wiki/Czynnik_pierwszy Section "Algorytm rozkladu na czynniki pierwsze" Thus the output of the program should look like: ''''''''''''''''''''''''''''''''''''''''''''''''''' Podaj liczbe do rozkladu na czynniki pierwsze: 56 Rozklad liczby 56 na czynniki pierwsze: 56 | 2 28 | 2 14 | 2 7 | 7 1 ''''''''''''''''''''''''''''''''''''''''''''''''''' 2) Binary and other numeral systems Read: https://en.wikipedia.org/wiki/List_of_numeral_systems https://en.wikipedia.org/wiki/Binary_code https://en.wikipedia.org/wiki/Binary_number#Conversion_to_and_from_other_numeral_systems * https://en.wikipedia.org/wiki/Binary_number#Binary_arithmetic https://en.wikipedia.org/wiki/Hexadecimal https://en.wikipedia.org/wiki/Octal * the algorithm described in this link are enough to do all today's exercids Additionally, see https://www.mimuw.edu.pl/~zawado/WI/WyklWI-C-sem1.pdf (page 53) Ex 2) Write a program with two functions (decimal2binary and binary2decimal). a) dec2bin(10) returns 1010, dec2bin(9000) returns 10001100101000, etc. b) bin2dec(11111) returns 31, bin2dec(1010) return 10, etc. Extra task*: Ex 3) Write a generic function that takes three parameters: i. the number to convert ii. the numeric system of the input iii. the numeric system of the output (the one to which you want to convert the number) base2base('10', 10, 2) returns ... base2base('11111', 2, 10) returns ... Moreover, limit the function to work for bases from 2 to 16 The alphabet (see also ASCII table) for hexadecimal numbers (frequently used case) is: char base_digits[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; Hints: a) based on bin2dec make generalised version any2dec, having already number as decimal make dec2any function b) for simplicity you can start with bases 2-10, digits and letters are separated in ASCII table thus you need to handle them separetely Usefull links: https://www.asciitable.com/ https://www.rapidtables.com/convert/number/hex-to-decimal.html https://sentry.io/answers/char-to-int-in-c-and-cpp/ https://www.codingeek.com/tutorials/c-programming/example/character-ascii-conversion/ This kind of solving of the tasks where you split complicated task into simpler parts that can be solved easier is fairly common in the informatics and it is called "divide and conquer" ** https://en.wikipedia.org/wiki/Divide-and-conquer_algorithm