0% found this document useful (0 votes)
32 views5 pages

CP - Assignment From 3 To 9

Uploaded by

Parv Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

CP - Assignment From 3 To 9

Uploaded by

Parv Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Assignment 3

1. Write a C program for printing prime factors of a number using functions.

2. Write a C program for printing prime numbers between a interval.

3. Write a C program to convert decimal to binary numbers & vice versa.

4. Write a C program to convert octal to binary & vice versa.

5. Write a C program to find mean, median, mode.

Assignment 4

6. Write a program in C to make such a pattern like a right angle triangle with a number, which will
repeat a number in a row.

The pattern like:

22

333

4444

7. Write a program in C to make a pyramid pattern with numbers increased by 1.

23

456

7 8 9 10

8. Write a program in C to print Floyd's Triangle.

01

101

0101

10101
9. Write a program in C to display a pattern like a diamond.

***

***

***

***

***

10. Write a C program to display Pascal's triangle.

Test Data :

Input number of rows: 5

Expected Output :

1 1

1 2 1

1 3 3 1

1 4 6 4 1

Assignment 5

11. Write a program in C to check whether a number can be expressed as the sum of two prime
numbers.

12. Write a C program to check whether a number is a Strong Number or not.

13. Write C program to convert binary to hexadecimal & vice versa.

14. Write a program in C to find the number and sum of all integers between 100 and 200 which are
divisible by 9.

15. Write a program to find out the second largest factor of a number. Eg. Input->100, Output-> 50.
Assignment 6

16. Write C Program to Find the Largest Element in an Array.

17. Write a C Program to Find the Maximum and Minimum in an Array.

18. Write C Program to Search an Element in an Array (Binary search)

19. Write a C Program to find all pairs in array of integers whose sum is equal to given number.

20. Write a C program for calculating the factorial of a number.

Assignment 7

21. Write a C program to generate fibonacci numbers and to find out if a given number is a fibonacci
number or not.

22. Write C programs to check, if an integer is a power of 2 or not in a single line.

23. Write code to remove duplicates in a sorted array.

24. Write C code to dynamically allocate one) two and three dimensional arrays using malloc.

25. Write C code to return a string from a function.

Assignment 8

26. Write a C program which produces its own source code as its output.
27. Write a C program to multiply two matrices.
28. Write a C program to check for palindromes.
29. Write a C program to convert a decimal number into a binary number.
30. Write a program to check, if a given year is a leap year or not.
Assignment 9

31. Write your own sqrt function in C.


32. Write a simple piece of code to split a string at equal intervals.
33. How can we sum the digits of a given number in single statement.
34. Write a C program to print a square matrix helically.
35. Write a C program generate permutations.
2.Write a C program to find the C of two numbers.2!.Write a program to print the pattern13
2 ! 10 ( ' %2.

You might also like