#include #include int main() { char ch ; printf( "Enter a character:" ) ; ch = getchar() ; printf ( "%c\n" , ch ) ; printf( "A literal string.\n" ) ; printf( "Using format specifiers. %d %d\n" , 5, 10 ) ; int x1 ; printf ( "Enter a number:" ) ; scanf( "%d" , &x1) ; printf( "x1 is %d\n" , x1 ) ; //Input buffer has the end of line character in it //creating a problem. getchar() ; //read the end of line character printf ( "Enter a number -number-:" ) ; scanf( "-%d-" , &x1) ; printf( "x1 is %d\n" , x1 ) ; getchar() ; char buffer[256] ; printf( "Enter your full name:" ) ; //Does not read the full name scanf( "%s" , buffer ) ; printf( "%s\n" , buffer ) ; //Clear the buffer scanf( "%s" , buffer ) ; printf( "%s\n" , buffer ) ; char ch1 = getchar() ; printf( "ch1: %d\n" , ch1 ) ; printf( "Enter your full name:" ) ; memset( buffer, 0 , 256 ) ; //Will read the whole line gets ( buffer ) ; printf( "%s\n" , buffer ) ; return ( 1) ; }