1 / 9

CYCLE 1 : Saisir – Afficher – Données Afficher du texte sur l’écran

CYCLE 1 : Saisir – Afficher – Données Afficher du texte sur l’écran. 1- Rôle du printf() 2- Syntaxe du printf() 3- Exécution du printf() par le CPU. ROLE DU PRINTF() SYNTAXE EXECUTION CPU. PROGRAMME. L’écran : périphérique d’affichage. S : affichage écriture. Ecran.

lavina
Download Presentation

CYCLE 1 : Saisir – Afficher – Données Afficher du texte sur l’écran

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CYCLE 1 : Saisir – Afficher – Données Afficher du texte sur l’écran 1- Rôle du printf() 2- Syntaxe du printf() 3- Exécution du printf() par le CPU

  2. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU PROGRAMME L’écran : périphérique d’affichage S : affichage écriture Ecran

  3. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU Nom:_ Ecran Rôle du printf() • L’affichage écran permet d’écrire du texte sur l’écran pour : • Informer l’utilisateur, • Demander des informations à l’utilisateur.

  4. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU Syntaxe du printf() #include <stdio.h> int main() { // AFFFICHAGE ECRAN d’un message printf("\tTexte\n"); }

  5. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU Gestion d’écran • Pour déplacer le curseur sur l’écran: • system("PAUSE") : attente avant de changer de page ou de quitter l’application. (bibliothèque stdlib.h) • system("cls") : écran effacé et curseur placé en haut à gauche. (bibliothèque stdlib.h) • \t dans le printf() : décalage d’un TAB à droite. • \n dans le printf() : passage en début de ligne suivante.

  6. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU Logiciel (Software) Langage C Programme source Matériel (Hardware) Binaire Programme exécutable Programmeur Programme Du programme source au programme exécutable

  7. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU Registres • Unité de commande • Unité de Contrôle UAL,ALU Unité de calcul RAM (Random Access Memory) ROM (Read Only Memory) Le CPU et la RAM Système de traitement automatique de l’information 1) Microprocesseur, CPU (Central Processing Unit), UC (Unité Centrale de traitement) 4) Mémoire Cache 3) Bus Système 2) Mémoire Centrale

  8. int main() { printf("\n\n\t\ta- Compter\n\tb- Sortir du programme\n\t\tChoix : ") ; ... } • ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU 1100 0000 exécution programme 1000 0000 1000 0110 1- compilation 2- édition de liens • Logiciel de traduction: Fichier source Exécutable La traduction ORDINATEUR DISQUE DUR RAM binaire langage C

  9. ROLE DU PRINTF() • SYNTAXE • EXECUTION CPU CPU Ecran Exécution CPU du printf() Fonctionnement de l’Instruction : AFFICHAGE ECRAN • Exécution par le CPU: • Arrivé à l’instruction d’Affichage: le CPU affiche le texte, là où se trouve le curseur de l’écran. • Le CPU exécute les ordres de passage à la ligne (\n) ou de tabulation (\t) lorsqu’il les rencontre. Coucou _ printf(“Coucou\n");

More Related