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

C Programming Practical Set 1

The document outlines a practical problem set for computer programming in C, including tasks such as calculating factorials, permutations, combinations, and the roots of quadratic equations. It also involves printing prime numbers within a specified range and calculating the probability density function for a normal distribution. Additionally, it requires the implementation of a piecewise function based on given conditions.
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)
6 views1 page

C Programming Practical Set 1

The document outlines a practical problem set for computer programming in C, including tasks such as calculating factorials, permutations, combinations, and the roots of quadratic equations. It also involves printing prime numbers within a specified range and calculating the probability density function for a normal distribution. Additionally, it requires the implementation of a piecewise function based on given conditions.
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

Computer Programming in C

Practical problem set 1


Date:

1. Write a program to calculate the factorial of a positive integer.

2. Write a program to obtain

i) nPr

ii) nCr

3. Write a program to calculate the roots of a quadratic equation.

4. i) Write a program to print all prime numbers between two integers and save the output in a file.

ii) Run the program to print all prime numbers between 50000 and 51240.

5. i) Write a program to calculate the pdf of X where X ~ N(µ,σ2).

ii) Use your program for filling up the following table:

x 1.12 1.5 2.32 .57 .34 3.58


f(x), X ~N(5,2)

6. Write a program to calculate the value of the following function:

f(x)= 2log(x)+Sin(x), 1<x<=2

= 2x3, 0<x<1

= 0 o.w.

You might also like