C Programing Project
C Programing Project
C programs are frequently asked in the interview. These programs can be asked from basics,
array, string, pointer, linked list, file handling etc. Let's see the list of c programs.
1) Fibonacci Series
Write a c program to print fibonacci series without using recursion and using
recursion.
Input: 10
Output: 0 1 1 2 3 5 8 13 21 34
2) Prime number
Write a c program to check prime number.
Input: 44
Output: not prime number
Input: 7
Output: prime number
3) Palindrome number
Write a c program to check palindrome number.
Input: 329
Output: not palindrome number
Input: 12321
Output: palindrome number
4) Factorial
Write a c program to print factorial of a number.
Input: 5
Output: 120
Input: 6
Output: 720
5) Armstrong number
Write a c program to check armstrong number.
Input: 153
Output: armstrong
Input: 22
Output: not armstrong
6) Sum of Digits
Write a c program to print sum of digits.
Input: 234
Output: 9
Input: 12345
Output: 15
7) Reverse Number
Write a c program to reverse given number.
Input: 123
Output: 321
8) Swap two numbers without using third variable
Write a c program to swap two numbers without using third variable.
Input: a=10 b=20
Output: a=20 b=10
9) Print "hello" without using semicolon
Write a c program to print "hello" without using semicolon
10) Assembly Program in C
Write a c program to add two numbers using assembly code.
11) C Program without main() function
Write a c program to print "Hello" without using main() function.
12) Matrix Multiplication
Write a c program to print multiplication of 2 matrices.
Input:
first matrix elements:
111
222
333
second matrix elements
111
222
333
Output:
multiplication of the matrix:
666
12 12 12
18 18 18
13) Decimal to Binary
Write a c program to convert decimal number to binary.
Input: 5
Output: 101
Input: 20
Output: 10100
14) Alphabet Triangle
Write a c program to print alphabet triangle.
Output:
A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
15) Number Triangle
Write a c program to print number triangle.
Input: 7
Output:
enter the range= 6
1
121
12321
1234321
123454321
12345654321
16) Fibonacci Triangle
Write a c program to generate fibonacci triangle.
Input: 5
Output:
1
1 1
1 1 2
1 1 2 3
1 1 2 3 5
17) Number in Characters
Write a c program to convert number in characters.
Input: 5
Output: five
Input: 203
Output: two zero three
50+ C Programs for Practice PDF Free Download
1. Simple C Questions
Area and Circumference of a Circle
Print Ascii Value of the Character
Area of Triangle
Convert a Person’s Name in Abbreviated
Simple Interest
Gross Salary of an Employee
Percentage of 5 Subjects
Converting Temperature Celsius into Fahrenheit
The Display Size of the Different Data Type
Factorial of a Given Number
Read Integer (N) and Print the First Three Powers (N^1, N^2, N^3)
Area of a Circle
LCM of Two Numbers
GCD of Two Numbers
2. If/Else Statement
The Greatest Number Among the Given Three Number
The Number Is Positive or Negative
Character Is Vowel or Consonant
A Character Is an Alphabet or Not
Uppercase, Lowercase, Special Character, or Digit
The Number Is Positive or Negative
The Number Is Even or Odd
Greatest of Two Numbers
Greatest Among Three Numbers
Leap Year
The Date Is Correct or Not
Voting Eligibility Checker
Find the maximum between two numbers.
Find the maximum between the three numbers.
Check whether a number is negative, positive or zero.
Check whether a number is divisible by 5 and 11 or not.
Find whether a number is even or odd.
Check whether a year is a leap year or not.
Check whether a character is an alphabet or not.
Input any alphabet and check whether it is vowel or consonant.
Input any character and check whether it is the alphabet, digit or special
character.
Check whether a character is an uppercase or lowercase alphabet.
Input week number and print weekday.
Input month number and print number of days in that month.
Count the total number of notes in a given amount.
Input angles of a triangle and check whether the triangle is valid or not.
Input all sides of a triangle and check whether the triangle is valid or not.
Check whether the triangle is an equilateral, isosceles or scalene triangle.
Find all roots of a quadratic equation.
Calculate profit or loss.
3. Loops
1. While Loop or While-Do Loop Questions
Reverse A given Number
Find Number Is Armstrong Or Not
Calculate Sum of Natural Numbers
Display Fibonacci Series
Find LCM of two Numbers
Reverse a Number
Check Whether a Number is A Palindrome or Not
Count Number of Digits of an Integer
Find A Generic Root Of Number
Print A Calendar Taking Input From User Using Loop
Number Is Divisible By 11 Using (VEDIC MATH)
Denomination of an Amount
2. Do-While Loop Questions
Solve the above program using Do-While Loop
3. For Loop Questions
Generate IP (Internet Protocol) Addresses Using
Print Multiplication Table Using
Sort A Float Array In Ascending And Descending Order Using
Find GCD of two Numbers Using
4. Switch Case
Temperature Conversion Celsius To Fahrenheit And Vice Versa
Find The Day
Calculator
Find A Grade Of Given Marks or (Find a Grade of Given Marks Using Switch
Case)
Find Radius, Circumference and Volume of Cylinder
Remove All Vowels From A String
Print day of week name using switch case.
Print total number of days in a month using switch case.
Check whether an alphabet is a vowel or consonant using a switch case.
Find the maximum between two numbers using the switch case.
Check whether a number is even or odd using a switch case.
Check whether a number is positive, negative or zero using a switch case.
Find roots of a quadratic equation using switch case.
Create a Simple Calculator using a switch case.
5. Array Questions
Insert An Element Desired or Specific Position In An Array
Remove Duplicates Items In An Array
Delete Element From Array At Desired Or Specific Position
Print “I AM IDIOT” Instead Of Your Name Using Array
Check String Is Palindrome Or Not Using For Loop
Convert All Input String Simultaneously Into Asterisk ( * )
Read and print elements of the array. – using recursion.
Print all negative elements in an array.
Sum of all array elements. – using recursion.
Find a maximum and minimum element in an array. – using recursion.
Get the second largest element in an array.
Count the total number of even and odd elements in an array.
Count the total number of negative elements in an array.
Copy all elements from an array to another array.
Insert an element in an array.
Delete an element from an array at the specified position.
Count frequency of each element in an array.
Print all unique elements in the array.
Count the total number of duplicate elements in an array.
Delete all duplicate elements from an array.
Merge two arrays to the third array.
Find the reverse of an array.
Put even and odd elements of an array in two separate arrays.
Search an element in an array.
Sort array elements in ascending or descending order.
Sort even and odd elements of the array separately.
Left rotate an array.
Right rotate an array.
6. Matrix Questions
Add two matrices.
Subtract two matrices.
Perform scalar matrix multiplication.
Multiply two matrices.
Check whether two matrices are equal or not.
Sum of the main diagonal elements of a matrix.
Find the sum of minor diagonal elements of a matrix.
Find the sum of each row and column of a matrix.
Interchange diagonals of a matrix.
The upper triangular matrix.
Find a lower triangular matrix.
Sum of the upper triangular matrix.
Find the sum of a lower triangular matrix.
The transpose of a matrix.
Find determinant of a matrix.
Identity matrix in C.
Check the sparse matrix.
Check the symmetric matrix.
Recommended posts
7. String Questions List
String Char-Case Change
A String is Palindrome or Not
A String Is an Anagram or Not
Find the length of a string.
Copy one string to another string.
Concatenate two strings.
Compare two strings.
Convert lowercase string to uppercase.
Convert uppercase string to lowercase.
Toggle case of each character of a string.
Find a total number of alphabets, digits or special character in a string.
Count the total number of vowels and consonants in a string.
Count the total number of words in a string.
Find the reverse of a string.
Check whether a string is a palindrome or not.
Reverse order of words in a given string.
8. String Questions: Level Up
Find the first occurrence of a character in a given string.
Find the last occurrence of a character in a given string.
Search all occurrences of a character in a given string.
Count occurrences of a character in a given string.
Find the highest frequency character in a string.
Find the lowest frequency character in a string.
Count the frequency of each character in a string.
Remove the first occurrence of a character from a string.
Remove the last occurrence of a character from a string.
Delete all occurrences of a character from a string.
Remove all repeated characters from a given string.
Replace the first occurrence of a character with another in a string.
Replace the last occurrence of a character with another in a string.
Put all occurrences of a character with another in a string.
Find the first occurrence of a word in a given string.
Find the last occurrence of a word in a given string.
Search all occurrences of a word in a given string.
Count occurrences of a word in a given string.
Remove the first occurrence of a word from the string.
Remove the last occurrence of a word in a given string.
Delete all occurrence of a word in a given string.
A Trim leading white space characters from a given string.
Trim trailing white space characters from a given string.
Trim both leading and trailing white space characters from a given string.
Remove all extra blank spaces from the given string.
9. Function Questions
Cube of any number using the function.
Find diameter, circumference and area of a circle using functions.
Maximum and minimum between two numbers using functions.
Check whether a number is even or odd using functions.
Check whether a number is prime, Armstrong or perfect number using
functions.
Find all prime numbers between the given interval using functions.
Print all strong numbers between the given interval using functions.
Armstrong numbers between the given interval using functions.
Print all perfect numbers between the given interval using functions.
Find the power of any number using recursion.
Print all natural numbers between 1 to n using recursion.
Print all even or odd numbers in a given range using recursion.
Sum of all natural numbers between 1 to n using recursion.
Find the sum of all even or odd numbers in a given range using recursion.
Find reverse of any number using recursion.
Check whether a number is a palindrome or not using recursion.
Find the sum of digits of a given number using recursion.
Find factorial of any number using recursion.
Generate nth Fibonacci term using recursion.
Find gcd (HCF) of two numbers using recursion.
Find lcm of two numbers using recursion.
Display all array elements using recursion.
Find the sum of elements of the array using recursion.
Find maximum and minimum elements in an array using recursion.
Stricmp() Function (Case In-Sensitive Compare)
Strncat() Function (String Concatenate)
Strstr() Function (Sub-String)
Strlwr() Function (To Lower-Case)
Strupr() Function (To Upper-Case)
Strncmp() Compare & Chars
Strncpy() Copy N Chars
Strrev() String Reverse
Strlen() String Length
Strcat() String Concatenate
Strcmp() String Compare
Strcpy() Copy the String
10. Pointer Questions
Add two numbers using pointers.
Swap two numbers using pointers.
Input and print array elements using a pointer.
Copy one array to another using pointer.
Swap two arrays using pointers.
Reverse an array using pointers.
Search an element in an array using pointers.
Access two-dimensional array using pointers.
Add two matrix using pointers.
Multiply two matrix using pointers.
Find the length of the string using pointers.
In short How to Copy one string to another using pointer.
Concatenate two strings using pointers.
Compare two strings using pointers.
Find the reverse of a string using pointers.
Sort array using pointers.
Return multiple values from a function using pointers.
11. File Handling
Create a file and write contents, save and close the file.
Read file contents and display them on the console.
Read numbers from a file and write even, odd and prime numbers to separate
file.
Append content to a file.
Compare two files.
How to Copy contents from one file to another file.
Merge two files to the third file.
Count characters, words and lines in a text file.
Delete a word from a text file.
Remove the specific line from a text file.
Remove empty lines from a text file.
Find the occurrence of a word in a text file.
Count occurrences of a word in a text file.
Count occurrences of all words in a text file.
Find and replace a word in a text file.
Replace a specific line in a text file.
Print source code of the same program.
Convert uppercase to the lowercase character and vice versa in a text file.
Find properties of a file using stat() function.
Check if a file or directory exists.
Rename a file using rename() function.
List all files and sub-directories recursively.
12. Sorting
Bubble Sort in C
Bucket or Radix Sort in C
Shell Sort in C
Merge Sort in C
Heap Sort in C
Selection Sort in C
Insertion Sort in C
13. Searching
Binary Search in C
Linear Search in C
Recursive Binary Search in C
14. Tricky Questions for Expert Only | Legendary level
This is a high-level section for legendary programmers or thinkers, this section can
help you to become a pro programmer. In this section, two categories are the number
pattern and start pattern. I just keep the pattern programming and number
programming separate. All the tricky questions or we can say that number
programming or start pattern programming solutions of c programming questions
and answers are below.
Number Series- C Programming Questions and Answers
Start Pattern Printing- C Programming Questions and Answers
Puzzles Questions
15. Puzzles Questions
Print numbers from 1 to n without using a semicolon?
Sum of two numbers without using any operator
How to show memory representation of c variables?
Condition to print “HelloWorld”
Modify/add only one character and print ‘*’ exactly 20 times
Sum the digits of a given number in a single statement?
Thanks