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

Functions

The document outlines a series of programming tasks, each requiring the creation of a specific function. Tasks include summing two numbers, checking even or odd, calculating factorial, finding the maximum of three numbers, reversing a number, checking for palindromes, printing multiplication tables, generating Fibonacci series, calculating power, and converting Celsius to Fahrenheit. Each task specifies the function's return type and parameters.

Uploaded by

sanketsupekar06
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)
4 views1 page

Functions

The document outlines a series of programming tasks, each requiring the creation of a specific function. Tasks include summing two numbers, checking even or odd, calculating factorial, finding the maximum of three numbers, reversing a number, checking for palindromes, printing multiplication tables, generating Fibonacci series, calculating power, and converting Celsius to Fahrenheit. Each task specifies the function's return type and parameters.

Uploaded by

sanketsupekar06
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

1.

Sum of Two Numbers

Write a func on int sum(int a, int b) that returns the sum of two integers.

2. Check Even or Odd

Write a void func on checkEvenOdd(int number) that prints whether the given number is even or
odd.

3. Factorial of a Number

Write a func on int factorial(int n) that returns the factorial of a given number n.

4. Maximum of Three Numbers

Write a func on int max(int a, int b, int c) that returns the greatest of three numbers.

5. Reverse a Number

Write a func on int reverseNumber(int num) that returns the reverse of the given number.

6. Check Palindrome

Write a func on boolean isPalindrome(int num) that checks if the number is a palindrome.

7. Print Mul plica on Table

Write a void func on printTable(int n) that prints the mul plica on table of n up to 10.

8. Fibonacci Series

Write a func on void printFibonacci(int terms) that prints the rst terms numbers of the Fibonacci
series.

9. Calculate Power

Write a func on int power(int base, int exponent) to compute the power of a number.

10. Convert Celsius to Fahrenheit

Write a func on double convertToFahrenheit(double celsius) that converts Celsius to Fahrenheit.


ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
ti
fi
ti

You might also like