0% found this document useful (0 votes)
15 views2 pages

LabSheet (Function)

The document outlines a series of lab exercises for C programming focused on functions. It includes tasks such as calculating the reverse of a number, finding the sum of integers, checking even or odd numbers, calculating simple interest, and working with temperature data. Additional exercises involve mathematical operations, prime checking, factorial calculation, power functions, and recursive functions for series calculations.

Uploaded by

patpoudel
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)
15 views2 pages

LabSheet (Function)

The document outlines a series of lab exercises for C programming focused on functions. It includes tasks such as calculating the reverse of a number, finding the sum of integers, checking even or odd numbers, calculating simple interest, and working with temperature data. Additional exercises involve mathematical operations, prime checking, factorial calculation, power functions, and recursive functions for series calculations.

Uploaded by

patpoudel
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/ 2

C programming

Lab Exercise (Function)

1. Write a C program to input a number and calculate its reverse using function

2. Write a C program to find the sum of ‘n’ integers numbers using function.

3. Write a C program to input a number and check if it is even or odd using the function.

4. Write a C program to input principal, rate and time and calculate simple interest using the function.

5. Write a C program to store Kathmandu Valley 7 days temperature and calculate average, maximum,

minimum temperature using function.

6. Write a program to accept two numbers perform addition, subtraction, multiplication, division between

them using user defined function called add( ), sub( ), div( ) and mul( ).

7. Write a program to find out the largest among three numbers using user defined function.

8. Write a function which receives a float and int from main(), finds the product of these two and returns

the product which is printed through main.

9. Write a program to check whether the given number is prime or not using user defined function.

10. Write a program to find factorial of a given number using user defined function named

long int factorial(int).

11. Write a program to calculate a raised to power b using user defined function with following prototype

int power(int,int).

12. Write a program to display factorial of a given number using recursive function.

13. Write a program to calculate sum of the series 1+2+3+4+…………+n using recursive function.

14. Write a program to calculate Fibonacci series using recursive function.

15. Write a program to calculate a raised to the power b using recursive function.

16. Write a recursive function to determine the factorial of a given number, write a program to calculate the

value of the following finite series.

Sum=1+(x/1!)+(x2/2!)+(x3/3!)+……………up to n terms.
Note: Also solve all the questions from your text book.

You might also like