CP - Assignment From 3 To 9
CP - Assignment From 3 To 9
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.
22
333
4444
23
456
7 8 9 10
01
101
0101
10101
9. Write a program in C to display a pattern like a diamond.
***
***
***
***
***
Test Data :
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.
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
19. Write a C Program to find all pairs in array of integers whose sum is equal to given 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.
24. Write C code to dynamically allocate one) two and three dimensional arrays using malloc.
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