B
bpascal123
Hi,
The code below doesn't display "Ending here" when the keyboard input
is '|'...Any reasons?
#include <stdio.h>
int main(void)
{
int a = 0 ;
int b = 0 ;
char sign = '|' ;
int stop = sign ;
printf("\nEnter 2 integers : \n") ;
while ((scanf("%d %d", &a, &b)) != 0)
{
if ((a == stop) || (b == stop))
{
printf("\nEnding here\n") ; // <== it skips this line
break ;
}
printf("\n%d%d\n", a, b) ;
}
return 0 ;
}
Pascal
The code below doesn't display "Ending here" when the keyboard input
is '|'...Any reasons?
#include <stdio.h>
int main(void)
{
int a = 0 ;
int b = 0 ;
char sign = '|' ;
int stop = sign ;
printf("\nEnter 2 integers : \n") ;
while ((scanf("%d %d", &a, &b)) != 0)
{
if ((a == stop) || (b == stop))
{
printf("\nEnding here\n") ; // <== it skips this line
break ;
}
printf("\n%d%d\n", a, b) ;
}
return 0 ;
}
Pascal