Lab Programs 6 Functions
Lab Programs 6 Functions
1. Write a C program to find maximum and minimum between two numbers using functions.
2. Write a C program to check whether a number is even or odd using functions.
3. Write a C program to check whether a number is prime, Armstrong or perfect number using
functions.
4. Write a program in C to find the square of any number using the function.
Test Data :Input any number for square : 20
Expected Output :The square of 20 is : 400.00
5. Write a program in C to convert a decimal number to a binary number using the function.
Test Data :Input any decimal number : 65
Expected Output :The Binary value is : 1000001
6. Write a program to calculate sum of first 20 natural numbers using recursive function.
7. Write a program to generate Fibonacci series using recursive function.
8. Write a program to swap two integers using call by value and call by reference methods
of passing arguments to a function.
9. Write a program to find sum of digits of the number using Recursive Function.
10. Write a program to factorial of the number using Recursive Function.