{"id":1594,"date":"2025-06-26T10:59:24","date_gmt":"2025-06-26T09:59:24","guid":{"rendered":"https:\/\/workboot.fr\/ciela\/?page_id=1594"},"modified":"2025-08-02T17:36:45","modified_gmt":"2025-08-02T16:36:45","slug":"td-printf","status":"publish","type":"page","link":"https:\/\/workboot.fr\/ciela\/td-printf\/","title":{"rendered":"printf , les formats"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Trouver ce qu&rsquo;affiche ce code c ansi<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><code>\/* Que donne ce programme \u00e0 l'affichage *\/\n\n#include &lt;stdio.h&gt;\n\nint main() {\n    \/* \ud83d\udd39 Exercice 1 : Affichage simple *\/\n    char nom&#91;] = \"Alice\";\n    int age = 20;\n    float note = 15.5;\n\n    printf(\"Exercice 1 :\\n\");\n    printf(\"Bonjour %s, tu as %d ans et tu as eu %.1f\/20 \u00e0 l'examen.\\n\\n\", nom, age, note);\n\n    \/* \ud83d\udd39 Exercice 2 : Affichage format\u00e9 *\/\n    float pi = 3.14159265;\n\n    printf(\"Exercice 2 :\\n\");\n    printf(\"Pi avec 2 d\u00e9cimales : %.2f\\n\", pi);\n    printf(\"Pi avec 4 d\u00e9cimales : %.4f\\n\", pi);\n    printf(\"Pi sur 10 caract\u00e8res, 3 d\u00e9cimales : %10.3f\\n\\n\", pi);\n\n    \/* \ud83d\udd39 Exercice 3 : Table de valeurs *\/\n    printf(\"Exercice 3 : Table de puissances\\n\");\n    printf(\"x    x^2    x^3\\n\");\n    for (int x = 1; x &lt;= 5; x++) {\n        printf(\"%-4d %-6d %-6d\\n\", x, x*x, x*x*x);\n    }\n    printf(\"\\n\");\n\n    \/* \ud83d\udd39 Exercice 4 : Affichage hexad\u00e9cimal et octal *\/\n    int n = 255;\n\n    printf(\"Exercice 4 :\\n\");\n    printf(\"D\u00e9cimal     : %d\\n\", n);\n    printf(\"Hexad\u00e9cimal : %x\\n\", n);\n    printf(\"Octal       : %o\\n\\n\", n);\n\n    \/* \ud83d\udd39 Exercice 5 : Alignement *\/\n    char mot&#91;] = \"Coucou\";\n\n    printf(\"Exercice 5 :\\n\");\n    printf(\"Align\u00e9 \u00e0 droite  : &#91;%10s]\\n\", mot); \/* largeur 10 *\/\n    printf(\"Align\u00e9 \u00e0 gauche  : &#91;%-10s]\\n\", mot); \/* largeur 10, align\u00e9 \u00e0 gauche *\/\n\n    return EXIT_SUCCESS;\n}\n<\/code><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary><\/summary>\n<pre class=\"wp-block-code\"><code>Exercice 1 :\nBonjour Alice, tu as 20 ans et tu as eu 15.5\/20 \u00e0 l'examen.\n\nExercice 2 :\nPi avec 2 d\u00e9cimales : 3.14\nPi avec 4 d\u00e9cimales : 3.1416\nPi sur 10 caract\u00e8res, 3 d\u00e9cimales :      3.142\n\nExercice 3 : Table de puissances\nx    x^2    x^3\n1    1      1     \n2    4      8     \n3    9      27    \n4    16     64    \n5    25     125   \n\nExercice 4 :\nD\u00e9cimal     : 255\nHexad\u00e9cimal : ff\nOctal       : 377\n\nExercice 5 :\nAlign\u00e9 \u00e0 droite  : &#91;    Coucou]\nAlign\u00e9 \u00e0 gauche  : &#91;Coucou    ]<\/code><\/pre>\n<\/details>\n","protected":false},"excerpt":{"rendered":"<p>Trouver ce qu&rsquo;affiche ce code c ansi<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-1594","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>printf , les formats - workboot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/workboot.fr\/ciela\/td-printf\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"printf , les formats - workboot\" \/>\n<meta property=\"og:description\" content=\"Trouver ce qu&rsquo;affiche ce code c ansi\" \/>\n<meta property=\"og:url\" content=\"https:\/\/workboot.fr\/ciela\/td-printf\/\" \/>\n<meta property=\"og:site_name\" content=\"workboot\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-02T16:36:45+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/td-printf\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/td-printf\\\/\",\"name\":\"printf , les formats - workboot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\"},\"datePublished\":\"2025-06-26T09:59:24+00:00\",\"dateModified\":\"2025-08-02T16:36:45+00:00\",\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/workboot.fr\\\/ciela\\\/td-printf\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"name\":\"workboot\",\"description\":\"Open Source, Open Minds \",\"publisher\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\",\"name\":\"workboot\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"contentUrl\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"width\":1024,\"height\":950,\"caption\":\"workboot\"},\"image\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"printf , les formats - workboot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/workboot.fr\/ciela\/td-printf\/","og_locale":"fr_FR","og_type":"article","og_title":"printf , les formats - workboot","og_description":"Trouver ce qu&rsquo;affiche ce code c ansi","og_url":"https:\/\/workboot.fr\/ciela\/td-printf\/","og_site_name":"workboot","article_modified_time":"2025-08-02T16:36:45+00:00","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/workboot.fr\/ciela\/td-printf\/","url":"https:\/\/workboot.fr\/ciela\/td-printf\/","name":"printf , les formats - workboot","isPartOf":{"@id":"https:\/\/workboot.fr\/ciela\/#website"},"datePublished":"2025-06-26T09:59:24+00:00","dateModified":"2025-08-02T16:36:45+00:00","inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/workboot.fr\/ciela\/td-printf\/"]}]},{"@type":"WebSite","@id":"https:\/\/workboot.fr\/ciela\/#website","url":"https:\/\/workboot.fr\/ciela\/","name":"workboot","description":"Open Source, Open Minds ","publisher":{"@id":"https:\/\/workboot.fr\/ciela\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/workboot.fr\/ciela\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/workboot.fr\/ciela\/#organization","name":"workboot","url":"https:\/\/workboot.fr\/ciela\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/","url":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","contentUrl":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","width":1024,"height":950,"caption":"workboot"},"image":{"@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/workboot.fr\/ciela\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Trouver ce qu&rsquo;affiche ce code c ansi","_links":{"self":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1594","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/comments?post=1594"}],"version-history":[{"count":7,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1594\/revisions"}],"predecessor-version":[{"id":3590,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/1594\/revisions\/3590"}],"wp:attachment":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/media?parent=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}