C/C++ programming examples and exercises for 3AIN/3BIN IIS Levi Ponti A.S. 2022-23
- Basic knowledge of computer usage
- Text editor basic usage
Documentation sites:
Development tools:
- Code::blocks (download available here or here)
- Visual studio code and its extensions like:
- C/C++ Extensions Pack
- Live Share Extension Pack
Other tools:
- flowgorithm (downloads available installer or executable)
Here you will find all the examples provided during the course.
Feel absolutely free to make them part of your work.
example | topic |
---|---|
test.c | a program to test your development environment |
base.c | basic program |
vars.c | basic variable declarations and usage |
out.c | basic output to stdout |
in.c | basic input from stdin |
io.cpp | I/O using iostream from stdin |
selezione_if.c | if - else |
selezione_switch.c | switch |
loops_while.c | loops: while |
loops_do-while.c | loops: do-while |
loops_for.c | loops: for |
data.c | do-while used to read and check a date |
functions.cpp | Esempio di functions in C++ |
MCDfunctions.c | Esempio di functions in C |
array.cpp | arrays: basic declaration and initialization |
array_basic.cpp | arrays: basic scan forward and backward |
array_utils.cpp | arrays: utility functions |
pseudorandom.cpp | (pseudo)random numbers |
cstring.cpp | C-style strings of chars |
string_utils.cpp | C-style string functions |
struct.cpp | structs |
ds_intro.md | Introduction to data structures |
data_structures.md | Dynamic and static data structures (summary) |
recursive | Recursive functions |
recursive products | Recursive product |
array_vs_struct | array vs struct comparison |
alloc_C | memory allocation C-style |
alloc_Cpp | memory allocation C++ using C-style |
alloc_Cpp_new_delete | memory allocation C++-style |
args | command line arguments |
average | average of command line arguments |
fileIO.md | File I/O examples (summary) |
bubblesort | BubbleSort derivation and optimization |
bubblesort.html | BubbleSort animation |
bubblesortmore | BubbleSort with struct and comparison functions |
selectionsort | SelectionSort derivation and optimization |
selectionsort.html | SelectionSort animation |
quicksort | QuickSort example |
sortcomparison | Comparison of different sort algorithms |
countsort | Examples of count sort |
Here you will find further information if you want a deeper insight.
You are free to skip all this...
Feel absolutely free to make them part of your work.
example | topic |
---|---|
arraymD.cpp | multidimensional arrays example |
array2Dcache.cpp | multidimensional arrays and cache |
arrays_allocation.cpp | multidimensional arrays allocation |
operators_functions.cpp | operator overloading and function parameters |
Here you will find some of the exercises assigned during the course and probably their solutions.
exercise | solution |
---|---|
bridges | here |
cifre | here |
base | here |
scomponi | here |
divisori | here |
power | here |
maxDivisore | here |
twoPrimes | here |
perfectNumber | here |
maxIntValues | here |
maxLongLongIntValues | here |
maxUIntValues | here |
primo | here |
bertrand | here |
Functions relative alle date | here |
cubes | here |
guess | 1.here |
guess | 2.here |
ordinato | here |
rotazioni | here |
isqrt | here |
monteCarlo | here |
lowertri | here |
uppertri | here |
assemblea | here |
diffprod | here |
actv | here |
maxFactors | here |
scomposizione | here |
divisori | here |
date | here |
geometry | here & here |
calc | here |
book | here |
teams | here |
teamsavg | here |
classi | here |
classiSoddisfatte | here |
sumint | here(TE), here(ME) and here(ok) |
config | here |
championship | here |
aggiorna | here |
friends | here |
Here you will find some of the lab test solutions.
The text of the problem is inside the source file.
- multipli.cpp
- prodotto.cpp
- comuni.cpp
- esclusivi.cpp
- residuo.cpp
- andamento.cpp
- maxsalita.cpp
- megarand.cpp
- minirand.cpp
- progressione.cpp
- powers.cpp
- remainders.cpp
- multiples.cpp
- arraycontrol.cpp
- geometria.h & geometria.cpp
- frazioni.h & frazioni.cpp
- periodo.h & periodo.cpp
- range.h & range.cpp
- cesare.cpp
- anagrammi.cpp
- distanza.cpp
- pascal.cpp
- password.cpp
- planet.cpp
- menu.cpp
- contaEscludi.cpp
- primesums.cpp
- compositesums.cpp
- fibosums.cpp
- dots.cpp
- next.cpp
- previous.cpp
- fusion.cpp
- sums.cpp
- comuniA.cpp
- comuniB.cpp
- codiciA.cpp
- codiciB.cpp