Today's exercise is about general C programming Warm up i) count to 100 and print only numbers that can be diveded by: a) 3 b) 5 c) 7 etc. ii) write infinite 'for' and 'while' loops a) modify them to add some condition to escape from the infinity e.g 'when n bigger/equal to 10000000 then stop' Conditions: what is better '>', '=', '>='? =========================================================================== 1) Write C program that will write on screen similar "square"-like picture AAAAAAAAAAAAAAAAAAAA AA AA A A A A A A A A A A A A A A A A A A A A A A A A A A A A A AA A A AA A A A A A A A A A A A A A A A A A A A A A A A A A A A A A AA AA AAAAAAAAAAAAAAAAAAAA Hint: use loops (e.g. for), if ... else statements, and logic operators (AND, OR, etc.) https://www.w3schools.com/c/c_for_loop.php 2) Rewrite the program: a) make function that takes one argument (the size of the square) and print the "square" inside of the function (thus no "return") b) modify the function (e.g. make another function) that prints as previously, but also returns number of 'A's c) get the square size from the user I/O (scanf) https://www.w3schools.com/c/c_user_input.php 3) Rewrite the program that it will use arrays a) first attempt: for simplicity fill the 2 x 1d arrays or 2d array with int b) second attempt: fill the array with chars, or/and use strings Hints: https://www.w3schools.com/c/c_arrays_multi.php https://www.w3schools.com/c/c_strings.php Extra exercises 1) given some array calculate: a) average b) min (both value and the index) c) max (both value and the index) 2) find second max or second min element (value and the index) 3) given long table with repetitions find the element that is the most frequent