0% found this document useful (0 votes)
9 views1 page

Functions and OOP Concepts Explained

The document contains questions and tasks related to programming concepts, including function invocation, call by value vs. call by reference, and the role of the void keyword. It also discusses function prototypes, the advantages of using functions, and concepts of pure and impure functions. Additionally, it includes programming exercises for overloading a function to calculate series sums based on given parameters.

Uploaded by

Rabindra Sahu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Functions and OOP Concepts Explained

The document contains questions and tasks related to programming concepts, including function invocation, call by value vs. call by reference, and the role of the void keyword. It also discusses function prototypes, the advantages of using functions, and concepts of pure and impure functions. Additionally, it includes programming exercises for overloading a function to calculate series sums based on given parameters.

Uploaded by

Rabindra Sahu
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

1. Differentiate between call by and call by reference.

2. What are the two ways of invoking functions?


3. What is the roll of the keyword void in declaring a function?
4. Write the prototype of a function which return true if a number is prime else return false.
5. Write two advantages of using functions in a program.
6. What is a pure function and what is an impure function?
7. In what way is OOPs principle polymorphism adopted in programming?
8. What is the output if 100 and 50 are passed to the following function?
Void paws(int a , int b)
{ a = a+b; b = a – b; b = a –b ; [Link](a+”,”+b);}
9. Differentiate between formal and actual parameter.
10. Write function prototypes
a. Prints the smallest of three numbers.

PROGRAMS
design a class to overload a function series () as follows

i. double series(double n) with one double argument an return the sum of the series.

1 1 1 1
∑ ¿ 1 + 2 + 3 +…+ n

ii. double series(double n) with one double argument an return the sum of the series.
1 4 7 10
∑ ¿ a 2 + a5 + a 8 + a11 +… n terms

You might also like