C Basic 50: Input using getchar()

4 January 2020, 11:11 pm by antelove19

C programming language

C programming language



Happy Coding


main.c

/* ------------------------------------------------------------ */
/*  Input                                                       */
/*  Using getchar()                                             */
/*                                                              */
/*  Author: antelove                                            */
/*  Website: antelove.com                                       */
/* ------------------------------------------------------------ */

#include <stdio.h> // standar input output library

int main() {

    char input;

    printf("Type a letter: \n");
    input = getchar();

    printf("You typed: %c \n", input);

    getchar(); // hold the screen

    return 0;

}

Thank for reading :)



No Action Title
1 Live
2 Editor
0 comment