I wrote c++ code in the codeblocks IDE. I use EOF but don't no which keyword i will use to exit form my code. Here is my code:
int main() {
int a, b;
while ( scanf("%d%d",&a,&b)!=EOF) {
printf ( "%d\n", a^b);
}
}
I wrote c++ code in the codeblocks IDE. I use EOF but don't no which keyword i will use to exit form my code. Here is my code:
int main() {
int a, b;
while ( scanf("%d%d",&a,&b)!=EOF) {
printf ( "%d\n", a^b);
}
}
The "scanf" return value is EOF for an error, or if the end-of-file character or the end-of-string character is found in the first attempt to read a character.
You can use "Ctrl + Z" in windows or "ctrl +D" for linux.
If you are using windows CTRL + C is the code for EOF() as Enter/Return key would add a newline only