Answers for "how to read keyboard input in c"

1

how to read keyboard input in c

#include <stdio.h>

int main(int argc, char *argv[])  
{
    printf("Enter some keys\n");
    char c;
    while((c = getchar()) != 13)   /* 13 is carriage ret in ascii, enter key */     
        printf("%c\n", c); 

    return 0;
}
Posted by: Guest on June-11-2021
1

get user input c

int c;
printf( "Enter a value :");
c = getchar( );
Posted by: Guest on June-30-2020

Code answers related to "how to read keyboard input in c"

Browse Popular Code Answers by Language