J
Jonathan
Hi--
I have the following code:
#include <stdio.h>
char a,b;
int main()
{
printf("Which character is greater?\n");
printf("Type a single character:");
a=getchar();
printf("Type another character:");
b=getchar();
printf("The first character is %c. The second character is %c.\n", a,
b);
return 0;
}
But when run, it takes only the input for the first character, then
continues without pausing for the next input:
[Session started at 2006-04-13 13:31:15 -0700.]
Which character is greater?
Type a single character:5
Type another character:The first character is 5. The second character is
..
What am I doing wrong?
Best,
Jonathan
I have the following code:
#include <stdio.h>
char a,b;
int main()
{
printf("Which character is greater?\n");
printf("Type a single character:");
a=getchar();
printf("Type another character:");
b=getchar();
printf("The first character is %c. The second character is %c.\n", a,
b);
return 0;
}
But when run, it takes only the input for the first character, then
continues without pausing for the next input:
[Session started at 2006-04-13 13:31:15 -0700.]
Which character is greater?
Type a single character:5
Type another character:The first character is 5. The second character is
..
What am I doing wrong?
Best,
Jonathan