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

Lab Programs 6 Functions

The document discusses 10 functions that can be written in C including functions to find maximum/minimum values, check if a number is even/odd, check properties of numbers, calculate squares, convert decimals to binaries, calculate sums of series, and swap/calculate on numbers using recursion.

Uploaded by

rakshika2580
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)
18 views1 page

Lab Programs 6 Functions

The document discusses 10 functions that can be written in C including functions to find maximum/minimum values, check if a number is even/odd, check properties of numbers, calculate squares, convert decimals to binaries, calculate sums of series, and swap/calculate on numbers using recursion.

Uploaded by

rakshika2580
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
You are on page 1/ 1

Functions in C

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.

You might also like