Hardware Reference
In-Depth Information
Figure 7.8 Output produced by the decimal to hexadecimal conversion
program
#include <stdio.h>
#define FOREVER 1
int main()
{
char c;
while (FOREVER)
{
menu();
c = getchar();
switch(c)
{
case '1':
init();
break;
case '2':
pump();
break;
case '3':
mix();
break;
case '4':
deliver();
break;
case '5':
exit();
default:
printf("Invalid input!\n");
printf("Please enter a number in the range [1] to [5]\n");
}
c = getchar();
}
return 0;
}
scroll(lines)
int lines;
{
int x;
for(x=0;x<lines; ++x)
Search WWH ::




Custom Search