tailieunhanh - Lecture Introduction to Computer Programming - Lecture 13

The contents of this chapter include all of the following: Describe the basic elements of a computer system and their interrelationship, eplain the steps taken by a processor to execute an instruction, understand the concept of interrupts and how and why a processor uses interrupts,. | CSC141- Introduction to Computer Programming Teacher: AHMED MUMTAZ MUSTEHSAN Lecture – 13 Thanks for lecture slides: 2000 Prentice Hall, Inc., C++ Spring 2000 Functions 3. 4. FUNCTIONS: A Quick Revision Functions A function is a self-contained block of statements that performs coherent task of some kind. OR A function groups a number of program statements into a unit and gives it a name. This unit or module can then be invoked from other parts of the program as many times as we need. Function Syntax #include void starline( ); //function declaration void main ( ) { starline ( ); //function Call cout void starline( ); //function declaration void main ( ) { starline ( ); //function Call cout<<“Hello World”; starline ( ); //function call getche( ); // call to library function } void starline ( ) // starline function definition { for ( int j=0; j < 45; j++ ) //function body cout<<“#”; cout<

TỪ KHÓA LIÊN QUAN