prog c
prog c
121
12321
1234321
123454321
11. Write a C program to find the greatest common divisor (GCD) of two numbers.
13. Write a program which takes integer input and then prints the number of even and odd digits
in that number.
14. Write a C program to simulate a simple calculator that performs addition, subtraction,
multiplication, or division based on user input.
15. Write a C program to generate Pascal’s Triangle up to a given number of rows.
16. Write a C program to find all Armstrong numbers within a given range.
17. Write a C program to print the following pattern (Diamond Pattern):
***
*****
*******
*******
*****
***
*
18. Write a C program to implement a simple menu-driven program for a bank account (deposit,
withdrawal, balance check).
19. Write a C program to check if a given number is a perfect number.
20. Write a C program to find the Least Common Multiple (LCM) of two numbers.
21. Write a C program to check if the given number is a strong number or not.
22. Write a C program to print all possible combinations of a 3 digit number, using 1,2,3 without
repeating digits.
6. Write a C program to concatenate two strings without using the `strcat()` function.
10. Write a C program to sort an array of integers in ascending order using bubble sort.
11. Write a C program to search for a specific element in an array using binary search (assume
the array is sorted).
19. Write a C program to find the longest common prefix among an array of strings.
20. Write a C program to implement a simple encryption/decryption algorithm (e.g., Caesar
cipher).
21. Write a C program to count the number of occurrences of a substring within a string.
22. Write a C program to sort an array of strings alphabetically.
23. Write a program to find the row and column with the maximum sum in a 2D array.
7. Write a C function to find the maximum element in an array, passing the array and its size as
arguments.
12. Write a function which takes an integer array and its size as input, and returns the second
largest element of the array.
13. Write a function to check if a number is perfect or not.
14. Write a function that accepts two matrices as input and returns their sum.
15. Write a recursive function to implement the Tower of Hanoi problem.
16. Write a recursive function to find the nth Fibonacci number efficiently (using memoization).
18. Write a function to find the sum of all prime numbers in a given range.
19. Write a recursive function to implement binary search.
21. Write a function that takes a string as input and returns a new string where all the vowels are
removed.
22. Write a function that accepts an array and its size as input, and then returns the mode of the
array’s elements.