//* Demonstrates: How to use compound exclusive if-else cases *

#include <stdio.h> int main() { double ph; printf("Welcome to a simple chemical expert system:\n"); printf("Please specify the PH for the substance.\n"); printf("ph="); scanf("%lf", &ph); if (ph<3.5) printf("It is very acidic!\a\n"); else if (ph<6.9) printf("It is acidic.\n"); else if (ph>9.5) printf("It is very basic!\a.\n"); else if (ph<7.1) printf("It is basic.\n"); else printf("It is about neutral.\n"); // in real life we do not have exact floating point numbers return(0); }