/* Program Name: sample1.c written by : Adnan El-Nasan Objective : how to use puts(). Usage : waits for an input from user. if input = 1 -> msg1 is printed out. if input = 2 -> msg2 is printed out. else -> quits; */ #include #include main() { int i; char *msg1 = "Hello there\n"; char *msg2 = "Welcome to the the 68HC11 enviornment\n"; while(1) { i = getchar(); if( (i=='1')||(i=='2') ) { if(i=='1') puts(msg1); if(i=='2') puts(msg2); } else exit(1); } }