//-------------------------------------------------------------- // demo1.c // // This very simple application program merely adds two // specified integers and prints out the resulting sum. // It is written using the C programming language, just // to illustrate the distinction between a "high-level" // language and a "low-level" language (like assembly). // This demo should be compared with 'demo2.s' which is // a "low-level" version of the very same computation. // // compile using: $ gcc demo1.c -o demo1 // // programmer: ALLAN CRUSE // written on: 27 AUG 2003 //-------------------------------------------------------------- #include // needed for 'printf()' int x = 4, y = 5; // initialized variables int z; // uninitialized variable int main() { z = x + y; // assignment statement printf( "%d + %d = %d \n", x, y, z ); // output }