Cours - Programmation

134 documents à télécharger gratuitement

Cours de programmation, partagés par des étudiants et des enseignants. Thèmes couverts : algorithmique, langage C, Java, Python, POO, structures de données.

Cours programmation en langage C: Les fonctions

The document covers the modularization of programs using functions in C programming to improve readability, reduce errors, and enhance efficiency. It introduces concepts like local and global variables, the definition and prototyping of functions, and parameter passing mechanisms. Various examples, including programs for factorial computation, rectangle drawing, value permutation, and computation of averages, illustrate the practical use of functions in C. Different function approaches are demonstrated to highlight the significance of local/global scope and pointer-based parameter handling.

modular programming
factorial calculation
function prototyping
12p0
Cours programmation en langage C : Chapitre 6 - Les pointeurs

This document is a detailed guide on pointers in C programming, covering direct and indirect addressing through variables and pointers. It explains the declaration, usage, and operations of pointers, including arithmetic and comparison. The relationship between pointers and arrays is explored, highlighting compact and efficient coding possibilities. Examples demonstrate pointer arithmetic, memory allocation principles, and usage scenarios for enhanced programming practices.

pointers
address operator (&)
dereference operator (*)
9p0
Cours Programmation en Langage C - Chapitre 6 : Les Pointeurs

This document, part of a programming course at École Supérieure de Technologie et d’Informatique, delves into the concept of pointers in the C programming language. It explains the fundamentals such as direct and indirect addressing, pointer syntax, and operations with pointers, emphasizing their role in memory management. The material includes detailed examples for using pointers with arrays, arithmetic operations, and differences between pointers and array names. Lastly, examples of pointer-based programs demonstrate their utility in writing compact and efficient code.

pointers
addressing operators & and *
pointer arithmetic
9p0
Les Pointeurs en Langage C

The document introduces pointers in C programming, discussing their definition, usage, and operations. It covers direct and indirect addressing, pointer initialization, basic operators '&' and '*', and interactions with arrays. Examples emphasize translating array indexing into pointer arithmetic for efficiency. Advanced concepts like pointer arithmetic, pointer comparisons, and pitfalls are illustrated with detailed code samples.

pointers
addressing
arrays
9p0
Cours Programmation en Langage C - Chapitre 3 : Les Entrées et Sorties

This document explains the standard library <stdio> in C for input-output operations. It categorizes the formatting symbols for functions like printf and scanf, which handle formatted data input and output. Multiple practical examples illustrate concepts such as left/right alignment, field width, and ASCII code usage with functions like putchar and getchar. Specific details are provided for reading, writing, and formatting various data types in C.

stdio
printf
scanf
3p0
Cours programmation en langage C - Chapitre 3 : Les entrées sorties

This document introduces input and output functions in the C programming language, covered in the third chapter of a programming course. Key standard functions, such as printf, scanf, getchar, and putchar, are explained alongside format specifiers for data representation and manipulation. Practical examples demonstrate the usage of these functions, including formatted data output, input reading, character writing, and ASCII operations. The document emphasizes correct handling of memory addresses for scanf and details specific examples for implementation and execution outputs.

C programming
printf
scanf
3p0
Cours programmation en langage C - Chapitre 2 : Opérateurs et expressions

This chapter introduces arithmetic, logical, relational, and assignment operators in the C programming language, explaining their syntax, functionality, and priority in expressions. It discusses implicit and explicit type conversions during operations, including rules for converting between types. Examples with accompanying source code demonstrate key concepts like operator precedence, casting, and the use of predefined functions from the math.h library for tasks such as calculating power and square roots. The chapter concludes with details on the use of conditional operators and the hierar...

operators in C
pow function
type conversion
7p0
Cours Programmation en Langage C : Opérateurs et Expressions

This document provides an in-depth explanation of arithmetic, relational, logical, and assignment operators in the C programming language, including details about operator precedence, implicit type conversion, and casting. Several code examples demonstrate the application of these operators, such as calculations involving modulo, square root, and ASCII character manipulation. The examples also highlight the importance of type hierarchy and casting for correct program execution. Additionally, it introduces a variety of mathematical functions from the 'math.h' library that are crucial in prog...

arithmetic operators
pow
type conversion
7p0
Cours programmation en langage C

The document introduces the C programming language, emphasizing its foundational principles and syntax. It provides examples of code execution, memory operations, and input/output functions, explaining essential concepts such as data types, format specifiers, and preprocessor directives. In addition, it covers program structure, compilation steps, and guidelines for writing readable and efficient code. Finally, special focus is given to categorical concepts like variable declarations, numerical types, floating-point representation, and character encoding.

C programming
ANSI standards
Brian W. Kernighan
9p0
Cours programmation en langage C: Généralités

This document introduces fundamental concepts of the C programming language, describing memory allocation for variables, data types, and the structure of programs. Core methodologies include the use of functions like printf and scanf for input/output operations, memory referencing techniques, and creation of executable programs using preprocessor directives. Examples and practical exercises are included to illustrate basic programming constructs and rules, providing foundational knowledge for beginners.

Brian W. Kernighan
ANSI C
variables and memory allocation
9p0
Introduction to Programming in C - General Overview

This lecture document provides foundational knowledge about programming in C, including historical context, basic syntax, variable declaration, and types. It explains core functionalities such as printf for output and scanf for input, emphasizing memory management and data types like integers, floating-point numbers, and characters. The document introduces programming structure, compilation steps, and preprocessor directives, offering examples to illustrate concepts such as variable initialization, memory addressing, and formatted input/output. Additionally, the importance of identifiers, k...

Brian Kernighan
Denis M. Ritchie
variable types
9p0
Cours Programmation en Langage C : Structures Alternatives et Répétitives

This document from the École Supérieure de Technologie et d’Informatique (2011/2012) provides an in-depth instructional guide on implementing alternative and repetitive structures in the C programming language. It details essential conditional instructions such as if-else, switch-case, and structured branching using goto, break, and continue. Moreover, it explains and demonstrates iterative control structures like while, do-while, and for loops, integrating practical examples for each. Emphasis is placed on understanding syntax, logic flow, and choosing the correct construct for specific pr...

C programming
if-else
while loop
11p0
Cours programmation en langage C: Chapitre 5 - Les tableaux

This document focuses on one-dimensional arrays in the C programming language and covers their definition, declaration, memory storage, initialization, and usage with examples. It explains how arrays are structured, accessed, and stored in memory, including details on initialization, reserving memory, and iterating over arrays using loops. Additional programming examples are provided to demonstrate working with arrays, including calculating sums and averages, reversing arrays, separating elements into sub-arrays, and finding minimum and maximum values with their indices.

arrays
C programming
programming examples
5p0
Cours programmation en langage C : Chapitre 5 - Les tableaux

This document presents a detailed discussion about arrays in the C programming language, including their definition, initialization, memory allocation, and common operations. It outlines key concepts with examples, such as one-dimensional array declaration, memory layout, and initialization. Practical examples of using arrays in various programming tasks like summation, reversing, splitting, and finding min/max values are also provided. Additionally, it emphasizes the importance of precise memory management and correct syntax when working with arrays.

arrays
int tab[5]
structured variables
5p0

Autres ressources en programmation