cs:c_language:basic_concepts
Return to Home page
If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it
You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/c_language/basic_concepts
Table of Contents
C Programming Languages (Basic concepts)
Commented examples
- while cycle 1: Insert 5 numbers using the keyboard and count how many even and odd numbers have been inserted.
- casting: Some examples about mathematical expressions and casting
- array 1: Print the first even number and its position of a 10 elements array/vector.
- functions 1: Multiplication of all the elements of a vector by 3.0, using a function (parameters are passed to the function by value).
Not commented examples
- while do-while for loops 1: A simple example about the utilization of the
while
,do-while
andfor
loops constructs to print numbers between da0
andn
. - array 2: find and print adjacent and equal values stored in an array
- functions and arrays 1: Pass an array to a function (by reference) and use of the library
ctype.h
. - strings 1: String in C and library
string.h
. - functions and matrices 1: Pass a matrix to a function (by reference).
- file reading 1: Example on how to read a file row-by-row, word-by-word, character-by-character and how to read a structured file (where field of different type are save in each row of the file).
- file writing 1: Writing data stored into structures in a file.
- argc and argv: Command line arguments
- write and read a binary file: Example on how to write or read a binary file
More specific exercises
- printf format: Use of the function
printf
to format the output - printf format inttypes.h: Use of the function printf to format the output of variables with fixed dimension, as defined in the <inttypes.h> library.
- max3: Compute the maximum value between 3 numbers
- leap year: Find if a year is a leap year
- boolean expressions: Examples regarding boolean expressions
- switch: The same program written in four different ways, the last by using the
switch
statement - calc: Use the
switch
statement to realize a simple calculator - sudoku: Solution of the sudoku game, given a
9×9
matrix with unknown numbers
Documentation
- http://man7.org/linux/man-pages/dir_section_3.html: Online documentation of C functions
Material in italian: concetti_base
If you found any error, or if you want to partecipate to the editing of this wiki, please contact: admin [at] skenz.it
You can reuse, distribute or modify the content of this page, but you must cite in any document (or webpage) this url: https://www.skenz.it/cs/c_language/basic_concepts
/web/htdocs/www.skenz.it/home/data/pages/cs/c_language/basic_concepts.txt · Last modified: 2024/04/08 22:35 by 127.0.0.1