List of C Program - 2
List of switch case programming exercises
1. Write a C program to print day of week name using switch case.
2. Write a C program print total number of days in a month using switch case.
3. Write a C program to check whether an alphabet is vowel or consonant using switch case.
4. Write a C program to find maximum between two numbers using switch case.
5. Write a C program to check whether a number is even or odd using switch case.
6. Write a C program to check whether a number is positive, negative or zero using switch case.
7. Write a C program to find roots of a quadratic equation using switch case.
8. Write a C program to create Simple Calculator using switch case.
List of if...else programming exercises
1. Write a C program to find maximum between two numbers.
2. Write a C program to find maximum between three numbers.
3. Write a C program to check whether a number is negative, positive or zero.
4. Write a C program to check whether a number is divisible by 5 and 11 or not.
5. Write a C program to check whether a number is even or odd.
6. Write a C program to check whether a year is leap year or not.
7. Write a C program to check whether a character is alphabet or not.
8. Write a C program to input any alphabet and check whether it is vowel or consonant.
9. Write a C program to input any character and check whether it is alphabet, digit or
special character.
List of loop programming exercises
1. Write a C program to print all natural numbers from 1 to n. - using while loop
2. Write a C program to print all natural numbers in reverse (from n to 1). - using while loop
3. Write a C program to print all alphabets from a to z. - using while loop
4. Write a C program to print all even numbers between 1 to 100. - using while loop
5. Write a C program to print all odd number between 1 to 100.
6. Write a C program to find sum of all natural numbers between 1 to n.
7. Write a C program to find sum of all even numbers between 1 to n.
8. Write a C program to find sum of all odd numbers between 1 to n.
9. Write a C program to print multiplication table of any number.
10. Write a C program to count number of digits in a number.
11. Write a C program to find first and last digit of a number.
12. Write a C program to find sum of first and last digit of a number.
13. Write a C program to swap first and last digits of a number.
14. Write a C program to calculate sum of digits of a number.
15. Write a C program to calculate product of digits of a number.
16. Write a C program to enter a number and print its reverse.
17. Write a C program to check whether a number is palindrome or not.
18. Write a C program to find frequency of each digit in a given integer.
19. Write a C program to enter a number and print it in words.
20. Write a C program to print all ASCII character with their values.
21. Write a C program to find power of a number using for loop.
22. Write a C program to find all factors of a number.
23. Write a C program to calculate factorial of a number.
24. Write a C program to find HCF (GCD) of two numbers.
25. Write a C program to find LCM of two numbers.
26. Write a C program to check whether a number is Prime number or not.
27. Write a C program to print all Prime numbers between 1 to n.
28. Write a C program to find sum of all prime numbers between 1 to n.
29. Write a C program to find all prime factors of a number.
30. Write a C program to check whether a number is Armstrong number or not.
31. Write a C program to print all Armstrong numbers between 1 to n.
32. Write a C program to check whether a number is Perfect number or not.
33. Write a C program to print all Perfect numbers between 1 to n.
34. Write a C program to check whether a number is Strong number or not.
35. Write a C program to print all Strong numbers between 1 to n.
36. Write a C program to print Fibonacci series up to n terms.
37. Write a C program to find one's complement of a binary number.
38. Write a C program to find two's complement of a binary number.
39. Write a C program to convert Binary to Octal number system.
40. Write a C program to convert Binary to Decimal number system.
41. Write a C program to convert Binary to Hexadecimal number system.
42. Write a C program to convert Octal to Binary number system.
43. Write a C program to convert Octal to Decimal number system.
44. Write a C program to convert Octal to Hexadecimal number system.
45. Write a C program to convert Decimal to Binary number system.
46. Write a C program to convert Decimal to Octal number system.
47. Write a C program to convert Decimal to Hexadecimal number system.
48. Write a C program to convert Hexadecimal to Binary number system.
49. Write a C program to convert Hexadecimal to Octal number system.
50. Write a C program to convert Hexadecimal to Decimal number system.
51. Write a C program to print Pascal triangle upto n rows.
52. Star pattern programs - Write a C program to print the given star patterns.
53. Number pattern programs - Write a C program to print the given number patterns
List of function and recursion programming exercises
1. Write a C program to find cube of any number using function.
2. Write a C program to find diameter, circumference and area of circle using functions.
3. Write a C program to find maximum and minimum between two numbers using functions.
4. Write a C program to check whether a number is even or odd using functions.
5. Write a C program to check whether a number is prime, Armstrong or perfect number using
functions.
6. Write a C program to find all prime numbers between given interval using functions.
7. Write a C program to print all strong numbers between given interval using functions.
8. Write a C program to print all Armstrong numbers between given interval using functions.
9. Write a C program to print all perfect numbers between given interval using functions.
10. Write a C program to find power of any number using recursion.
11. Write a C program to print all natural numbers between 1 to n using recursion.
12. Write a C program to print all even or odd numbers in given range using recursion.
13. Write a C program to find sum of all natural numbers between 1 to n using recursion.
14. Write a C program to find sum of all even or odd numbers in given range using recursion.
15. Write a C program to find reverse of any number using recursion.
16. Write a C program to check whether a number is palindrome or not using recursion.
17. Write a C program to find sum of digits of a given number using recursion.
18. Write a C program to find factorial of any number using recursion.
19. Write a C program to generate nth Fibonacci term using recursion.
20. Write a C program to find GCD (HCF) of two numbers using recursion.
21. Write a C program to find LCM of two numbers using recursion.
22. Write a C program to display all array elements using recursion.
23. Write a C program to find sum of elements of array using recursion.
24. Write a C program to find maximum and minimum elements in array using recursion.
List of string programming exercises
1. Write a C program to find length of a string.
2. Write a C program to copy one string to another string.
3. Write a C program to concatenate two strings.
4. Write a C program to compare two strings.
5. Write a C program to convert lowercase string to uppercase.
6. Write a C program to convert uppercase string to lowercase.
7. Write a C program to toggle case of each character of a string.
8. Write a C program to find total number of alphabets, digits or special character in a string.
9. Write a C program to count total number of vowels and consonants in a string.
10. Write a C program to count total number of words in a string.
11. Write a C program to find reverse of a string.
12. Write a C program to check whether a string is palindrome or not.
13. Write a C program to reverse order of words in a given string.
14. Write a C program to find first occurrence of a character in a given string.
15. Write a C program to find last occurrence of a character in a given string.
16. Write a C program to search all occurrences of a character in given string.
17. Write a C program to count occurrences of a character in given string.
18. Write a C program to find highest frequency character in a string.
19. Write a C program to find lowest frequency character in a string.
20. Write a C program to count frequency of each character in a string.
21. Write a C program to remove first occurrence of a character from string.
22. Write a C program to remove last occurrence of a character from string.
23. Write a C program to remove all occurrences of a character from string.
24. Write a C program to remove all repeated characters from a given string.
25. Write a C program to replace first occurrence of a character with another in a string.
26. Write a C program to replace last occurrence of a character with another in a string.
27. Write a C program to replace all occurrences of a character with another in a string.
28. Write a C program to find first occurrence of a word in a given string.
29. Write a C program to find last occurrence of a word in a given string.
30. Write a C program to search all occurrences of a word in given string.
31. Write a C program to count occurrences of a word in a given string.
32. Write a C program to remove first occurrence of a word from string.
33. Write a C program to remove last occurrence of a word in given string.
34. Write a C program to remove all occurrence of a word in given string.
35. Write a C program to trim leading white space characters from given string.
36. Write a C program to trim trailing white space characters from given string.
37. Write a C program to trim both leading and trailing white space characters from given string.
38. Write a C program to remove all extra blank spaces from given string.
List of pointer programming exercises
1. Write a C program to create, initialize and use pointers.
2. Write a C program to add two numbers using pointers.
3. Write a C program to swap two numbers using pointers.
4. Write a C program to input and print array elements using pointer.
5. Write a C program to copy one array to another using pointers.
6. Write a C program to swap two arrays using pointers.
7. Write a C program to reverse an array using pointers.
8. Write a C program to search an element in array using pointers.
9. Write a C program to access two dimensional array using pointers.
10. Write a C program to add two matrix using pointers.
11. Write a C program to multiply two matrix using pointers.
12. Write a C program to find length of string using pointers.
13. Write a C program to copy one string to another using pointers.
14. Write a C program to concatenate two strings using pointers.
15. Write a C program to compare two strings using pointers.
16. Write a C program to find reverse of a string using pointers.
17. Write a C program to sort array using pointers.
18. Write a C program to return multiple value from function using pointers.
List of file handling exercises
1. Write a C program to create a file and write contents, save and close the file.
2. Write a C program to read file contents and display on console.
3. Write a C program to read numbers from a file and write even, odd and prime numbers to
separate file.
4. Write a C program to append content to a file.
5. Write a C program to compare two files.
6. Write a C program to copy contents from one file to another file.
7. Write a C program to merge two file to third file.
8. Write a C program to count characters, words and lines in a text file.
9. Write a C program to remove a word from text file.
10. Write a C program to remove specific line from a text file.
11. Write a C program to remove empty lines from a text file.
12. Write a C program to find occurrence of a word in a text file.
13. Write a C program to count occurrences of a word in a text file.
14. Write a C program to count occurrences of all words in a text file.
15. Write a C program to find and replace a word in a text file.
16. Write a C program to replace specific line in a text file.
17. Write a C program to print source code of same program.
18. Write a C program to convert uppercase to lowercase character and vice versa in a text file