c program using logical operators