Nothing Special   »   [go: up one dir, main page]

Function Exercises

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

1.

 Write a program in C# Sharp to create a user define function. 


2. Write a program in C# Sharp to create a user define function with parameters. 

3. Write a program in C# Sharp to create a function for the sum of two numbers. 

4. Write a program in C# Sharp to create a function to input a string and count


number of spaces are in the string. 

5. Write a program in C# Sharp to calculate the sum of elements in an array.

6. Write a program in C# Sharp to create a function to swap the values of two


integer numbers.

7. Write a program in C# Sharp to create a function to calculate the result of


raising an integer number to another.

8. Write a program in C# Sharp to create a function to display the n number


Fibonacci sequence. 

9. Write a program in C# Sharp to create a function to check whether a number is


prime or not. 

10. Write a program in C# Sharp to create a function to calculate the sum of the


individual digits of a given number. 

11. Write a program in C# Sharp to create a recursive function to find the factorial


of a given number.

12. Write a program in C# Sharp to create a recursive function to calculate the


Fibonacci number of a specific term.

You might also like