//* Demonstrates: How to use efficiently 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<6.9) if (ph<3.5) printf("It is very acidic!\a\n"); else printf("It is acidic.\n"); else if (ph<7.1) printf("It is about neutral.\n"); else if (ph<=9.5) printf("It is basic.\n"); else printf("It is very basic!\a.\n"); return(0); }