Read and print integer

    0

    2

    Giovanny Gongora

    Codiga's C Recipes

    The integer entered by the user is stored in a variable and printed on the screen

    #include <stdio.h>
    
    int main() {   
      int number;
      printf("Enter an integer: ");  
      // reads and stores input
      scanf("%d", &number);
      // displays output
      printf("You entered: %d", number);
      return 0;
    }
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.