~lecture11.pptx

# ~lecture11.pptx - Course Programming Fundamentals 4.00...

This preview shows pages 1–7. Sign up to view the full content.

Course: Programming Fundamentals 4.00 Credit Hours, Fall 2015, Graduate Program Instructor: Maryam Ehsan SESSION 2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 Today’s lecture outline Menu driven program using functions Function call by value Scope of variable Local Global
3 Menu driven program using functions Menu is Factorial of a number Prime number Even or odd Exit

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4 Passing Values between Functions The mechanism used to convey information to the function is the ‘argument’ or ‘parameter’ You have already used the arguments in the printf( ) and scanf( ) function the format string and the list of variables used inside the parentheses in these functions are arguments
5 Example program a b c sum x y z d Program Output Enter any three number: 5 6 2 Sum = 13 Press any key to continue . . . 5 6 2 6 5 2 13 Sum = 13 13 Go to program

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
6 Points to remember The variables a, b and c are called ‘actual arguments’, whereas the variables x, y and z are called ‘formal arguments’
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern