tailieunhanh - Lecture Computing for management - Chapter 28

After studying this chapter you will be able to understand learn what a stream is and examine input and output streams; explore how to read data from the standard input device; learn how to use predefined functions in a program; explore how to use the input stream functions get, ignore, putback, and peek; | Algorithms and Programming Functions Lecture 28 CSE1301 Sem 2 - 2003 Lecture 12: Algorithm Design Summary of Previous Lecture while statement for statement break statement Nested loops CSE1301 Sem 2 - 2003 Lecture 12: Algorithm Design Summary of C program execution steps We are using Turbo C for editing source code Our Source code is passed to the compiler which checks Errors and translate your source code into machine code Object Code is formed after compilation, which is computer understandable code! Linker Links Object Code formed with the other Library Files Library Files path settings which you already configured! All the header files including are placed here! After Linking, executable file is formed , Loader loads it into memory for further processes Today’s Topics Algorithms Functions Using functions in top-down design Functions in C Language User defined Functions Parameters Return values Functions A named sequence of instructions Also known as: modules, procedures, subroutines, . Give a name to a standard, frequently used sequence of actions Specify ("call") that sequence by name Function Definition Define a function as: { } Example: Inviting Saad to a party Function Definition InviteToParty { dial 9876-5432 say "Hello Saad, it's " sayMyName() say "Would you like to come to my party on 10 July?" say "It's at 1 Ravi Road." say "Great! See you then. Bye Saad" hangUp() } Function Parameters Functions may have parameters They specify variations from call to call So that the same function can do different things Depending on the value of the parameters Function Parameters For example: √4 = 2 √36 = 6 Both the above can be thought of as “calls” to the square root function But one returns 2, the other returns 6 Depending on the value of the parameter Function Definition Define a function with parameters as: ( ,, . ) { } Example: Inviting someone to a party . | Algorithms and Programming Functions Lecture 28 CSE1301 Sem 2 - 2003 Lecture 12: Algorithm Design Summary of Previous Lecture while statement for statement break statement Nested loops CSE1301 Sem 2 - 2003 Lecture 12: Algorithm Design Summary of C program execution steps We are using Turbo C for editing source code Our Source code is passed to the compiler which checks Errors and translate your source code into machine code Object Code is formed after compilation, which is computer understandable code! Linker Links Object Code formed with the other Library Files Library Files path settings which you already configured! All the header files including are placed here! After Linking, executable file is formed , Loader loads it into memory for further processes Today’s Topics Algorithms Functions Using functions in top-down design Functions in C Language User defined Functions Parameters Return values Functions A named sequence of instructions Also known as: modules, .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.