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

Additional Functions Assignment

The document outlines a series of tasks for an additional C++ assignment focused on user-defined functions. Each task requires the implementation of specific functions, such as checking for prime numbers, reversing a number, and performing operations like finding the maximum in an array or calculating Fibonacci numbers. The assignment also includes concepts like function overloading, using references, and working with structures and 2D arrays.

Uploaded by

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

Additional Functions Assignment

The document outlines a series of tasks for an additional C++ assignment focused on user-defined functions. Each task requires the implementation of specific functions, such as checking for prime numbers, reversing a number, and performing operations like finding the maximum in an array or calculating Fibonacci numbers. The assignment also includes concepts like function overloading, using references, and working with structures and 2D arrays.

Uploaded by

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

C++ Additional Assignment: Functions

Additional Assignment: User-Defined Functions in C++

Task 11: Write a function bool isPrime(int n)

Task 12: Write void checkEvenOdd(int n)

Task 13: Write int reverseNumber(int n)

Task 14: Write int sumOfDigits(int n)

Task 15: Write int power(int base, int exp)

Task 16: Write int findMax(int arr[], int size)

Task 17: Write int searchElement(int arr[], int size, int key)

Task 18: Write bool isPalindrome(string str)

Task 19: Write void fibonacci(int n)

Task 20: Write recursive int fib(int n)

Task 21: Function using reference to find sum and product

Task 22: Function with static variable counter()

Task 23: Inline function cube(int x)

Task 24: Overloaded print() with default argument

Task 25: Menu driven calculator using functions

Task 26: Reverse array using function

Task 27: Count words in string

Task 28: Function pointer example

Task 29: Armstrong number function

Task 30: Strong number function

Task 31: Swap by value vs reference

Task 32: Nested function calls

Task 33: Function with structure

Task 34: Function with 2D array (matrix addition)

Task 35: Sort array using function

You might also like