Write program to use logical OR operator inside if statement
Use logical OR operation to make the condition true when the value of variable coordinate is less than -5 or greater than 5.
The OR operator is ||
#include <stdio.h> int main()/*from w w w .j a v a2 s . c o m*/ { int coordinate; printf("Input target coordinate: "); scanf("%d",&coordinate); if( coordinate < -5 || coordinate > 5 ) { puts("Close enough!"); } else { puts("Target is out of range!"); } return(0); }