Solution for Exercise 7-4
ex0704
#include <stdio.h>
int main()
{
int a,b,c;
printf("I'm waiting for three characters: ");
a = getchar();
b = getchar();
c = getchar();
printf("The three characters are '%c', '%c', and '%c'\n",a,b,c);
return(0);
}
Output
I'm waiting for three charcters: YXZ
The three characters are 'X', 'Y', and 'Z'
Notes
* Remember: getchar() is not an interactive function, neither is any function that reads stream input.
Copyright © 1997-2025 by QPBC.
All rights reserved
