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

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

View Full Document Right Arrow Icon
Course: Programming Fundamentals 4.00 Credit Hours, Fall 2015, Graduate Program Instructor: Maryam Ehsan SESSION 2
Image of page 1

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

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

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

View Full Document Right Arrow Icon
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
Image of page 4
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
Image of page 5

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

View Full Document Right Arrow Icon
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’
Image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern