0% found this document useful (0 votes)
236 views13 pages

250 - C Programs For Practice PDF

The document contains a list of 250+ C programs divided into categories like simple programs, if/else statements, loops, arrays, matrices, and strings. The programs cover basic concepts and increase in complexity. The goal is to provide practice problems to learn C programming.

Uploaded by

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

250 - C Programs For Practice PDF

The document contains a list of 250+ C programs divided into categories like simple programs, if/else statements, loops, arrays, matrices, and strings. The programs cover basic concepts and increase in complexity. The goal is to provide practice problems to learn C programming.

Uploaded by

Rohit.Kulkarni.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
  • Simple C Questions
  • Loops
  • Switch Case
  • Array Questions
  • Matrix Questions
  • String Questions List
  • Function Questions
  • Pointer Questions
  • File Handling
  • Searching
  • Sorting
  • Tricky Questions for Expert Only
  • Puzzles Questions

250+ C Programs for Practice PDF

Free Download

m
1. Simple C Questions

co
● Area and Circumference of a Circle

s.
● Print Ascii Value of the Character

ic
● Area of Triangle

as
● Convert a Person’s Name into an Abbreviated

b
● Simple Interest
ith
● Gross Salary of an Employee

● Percentage of 5 Subjects
gw

● Converting Temperature Celsius into Fahrenheit


in

● The Display Size of the Different Data Types

● Factorial of a Given Number


m

● Read Integer (N) and Print the First Three Powers (N^1, N^2, N^3)
am

● Area of a Circle
gr

● LCM of Two Numbers

● GCD of Two Numbers


ro
p

2. If/Else Statement
● The Greatest Number Among the Given Three Numbers

● 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

m
● Greatest of Two Numbers

co
● Greatest Among Three Numbers

● Leap Year

s.
● The Date Is Correct or Not

ic
● Voting Eligibility Checker

as
● Find the maximum between two numbers.

b
● Find the maximum between the three numbers.
ith
● Check whether a number is negative, positive or zero.

● Check whether a number is divisible by 5 and 11 or not.


gw

● Find whether a number is even or odd.


in

● Check whether a year is a leap year or not.


m

● Check whether a character is an alphabet or not.

● Input any alphabet and check whether it is a vowel or consonant.


am

● Input any character and check whether it is the alphabet, digit or special
gr

character.

● Check whether a character is an uppercase or lowercase alphabet.


ro

● Input the week number and print the weekday.


p

● Input the month number and print the number of days in that month.

● Count the total number of notes in a given amount.

● Input the 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

m
co
1. While Loop or While-Do Loop Questions

s.
ic
● Reverse A given Number

as
● Find Number Is Armstrong Or Not

● Calculate the Sum of Natural Numbers

b
● Display Fibonacci Series
ith
● Find the LCM of two Numbers
gw

● Reverse a Number

● Check Whether a Number is A Palindrome or Not


in

● Count the Number of Digits of an Integer


m

● Find A Generic Root Of the Number


am

● Print A Calendar Taking Input From User Using Loop

● Number Is Divisible By 11 Using (VEDIC MATH)


gr

● Denomination of an Amount
ro

2. Do-While Loop Questions


p

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

m
● Find the GCD of two Numbers Using

co
4. Switch Case

s.
ic
● Temperature Conversion Celsius To Fahrenheit And Vice Versa

as
● Find The Day

● Calculator
b
● Find A Grade Of Given Marks or (Find a Grade of Given Marks Using
ith
Switch Case)
gw

● Find the Radius, Circumference and Volume of the Cylinder

● Remove All Vowels From A String


in

● Print the day of the week name using a switch case.


m

● Print the total number of days in a month using a switch case.


am

● Check whether an alphabet is a vowel or consonant using a switch case.

● Find the maximum between two numbers using the switch case.
gr

● Check whether a number is even or odd using a switch case.


ro

● Check whether a number is positive, negative or zero using a switch case.


p

● Find the roots of a quadratic equation using a 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

m
● Print “I AM IDIOT” Instead Of Your Name Using Array

co
● Check String Is Palindrome Or Not Using For Loop

● Convert All Input String Simultaneously Into Asterisk ( * )

s.
● Read and print elements of the array. – using recursion.

ic
● Print all negative elements in an array.

as
● Sum of all array elements. – using recursion.

b
● Find a maximum and minimum element in an array. – using recursion.
ith
● Get the second largest element in an array.

● Count the total number of even and odd elements in an array.


gw

● Count the total number of negative elements in an array.


in

● Copy all elements from an array to another array.


m

● Insert an element in an array.


am

● Delete an element from an array at the specified position.

● Count the frequency of each element in an array.


gr

● Print all unique elements in the array.

● Count the total number of duplicate elements in an array.


ro

● Delete all duplicate elements from an array.


p

● 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

m
co
● Add two matrices.

s.
● Subtract two matrices.

ic
● Perform scalar matrix multiplication.

as
● Multiply two matrices.

● Check whether the two matrices are equal or not.


b
ith
● Sum of the main diagonal elements of a matrix.

● Find the sum of minor diagonal elements of a matrix.


gw

● Find the sum of each row and column of a matrix.

● Interchange diagonals of a matrix.


in

● The upper triangular matrix.


m

● Find a lower triangular matrix.


am

● Sum of the upper triangular matrix.

● Find the sum of a lower triangular matrix.


gr

● The transpose of a matrix.


ro

● Find the determinant of a matrix.


p

● 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

m
● A String Is an Anagram or Not

co
● Find the length of a string.

s.
● Copy one string to another string.

ic
● Concatenate two strings.

as
● Compare two strings.

● Convert lowercase string to uppercase.


b
ith
● Convert uppercase string to lowercase.

● Toggle the case of each character of a string.


gw

● Find the total number of alphabets, digits or special characters in a string.

● Count the total number of vowels and consonants in a string.


in

● Count the total number of words in a string.


m

● Find the reverse of a string.


am

● Check whether a string is a palindrome or not.

● Reverse the order of words in a given string.


gr
ro

8. String Questions: Level Up


p

● 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.

m
● Remove the last occurrence of a character from a string.

co
● Delete all occurrences of a character from a string.

● Remove all repeated characters from a given string.

s.
● Replace the first occurrence of a character with another in a string.

ic
● Replace the last occurrence of a character with another in a string.

as
● Put all occurrences of a character with another in a string.

b
● Find the first occurrence of a word in a given string.
ith
● Find the last occurrence of a word in a given string.

● Search all occurrences of a word in a given string.


gw

● Count occurrences of a word in a given string.


in

● Remove the first occurrence of a word from the string.


m

● Remove the last occurrence of a word in a given string.

● Delete all occurrences of a word in a given string.


am

● A Trim leading white space characters from a given string.


gr

● Trim trailing white space characters from a given string.

● Trim both leading and trailing white space characters from a given string.
ro

● Remove all extra blank spaces from the given string.


p

9. Function Questions
● Cube of any number using the function.
● Find the 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 a prime, Armstrong or perfect number using

functions.

m
● Find all prime numbers between the given interval using functions.

co
● Print all strong numbers between the given interval using functions.

● Armstrong numbers between the given interval using functions.

s.
● Print all perfect numbers between the given interval using functions.

ic
● Find the power of any number using recursion.

as
● Print all natural numbers between 1 to n using recursion.

b
● Print all even or odd numbers in a given range using recursion.
ith
● 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.
gw

● Find the reverse of any number using recursion.


in

● Check whether a number is a palindrome or not using recursion.


m

● Find the sum of digits of a given number using recursion.

● Find the factorial of any number using recursion.


am

● Generate nth Fibonacci term using recursion.


gr

● Find the gcd (HCF) of two numbers using recursion.

● Find the lcm of two numbers using recursion.


ro

● Display all array elements using recursion.


p

● 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

m
● Strrev() String Reverse

co
● Strlen() String Length

● Strcat() String Concatenate

s.
● Strcmp() String Compare

ic
● Strcpy() Copy the String

as
b
10. Pointer Questions
ith
● Add two numbers using pointers.
gw

● Swap two numbers using pointers.

● Input and print array elements using a pointer.


in

● Copy one array to another using pointer.


m

● Swap two arrays using pointers.


am

● Reverse an array using pointers.

● Search an element in an array using pointers.


gr

● Access two-dimensional array using pointers.


ro

● Add two matrices using pointers.


p

● Multiply two matrices 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

m
co
● Create a file and write contents, save and close the file.

s.
● Read file contents and display them on the console.

ic
● Read numbers from a file and write even, odd and prime numbers to

as
separate files.

● Append content to a file.


b
ith
● Compare two files.

● How to Copy contents from one file to another file.


gw

● Merge two files into the third file.

● Count characters, words and lines in a text file.


in

● Delete a word from a text file.


m

● Remove the specific line from a text file.


am

● Remove empty lines from a text file.

● Find the occurrence of a word in a text file.


gr

● Count occurrences of a word in a text file.


ro

● Count occurrences of all words in a text file.


p

● Find and replace a word in a text file.

● Replace a specific line in a text file.

● Print the 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

m
co
● Bubble Sort in C

s.
● Bucket or Radix Sort in C

ic
● Shell Sort in C

as
● Merge Sort in C

● Heap Sort in C
b
ith
● Selection Sort in C

● Insertion Sort in C
gw

13. Searching
in
m

● Binary Search in C
am

● Linear Search in C

● Recursive Binary Search in C


gr

14. Tricky Questions for Expert Only | Legendary


ro

level
p

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 the 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.

m
● Number Series- C Programming Questions and Answers

● Start Pattern Printing- C Programming Questions and Answers

co
● Puzzles Questions

s.
ic
15. Puzzles Questions

as
● Print numbers from 1 to n without using a semicolon.

b
● Sum of two numbers without using any operator
ith
● How to show the memory representation of c variables?
gw

● Condition to print “HelloWorld”

● Modify/add only one character and print ‘*’ exactly 20 times


in

● Sum the digits of a given number in a single statement.


m

For Solutions Please Visit.


am

[Link]
gr

html
ro

Thanks
p

programmingwithbasics.com
250+ C Programs for Practice PDF
Free Download
1. Simple C Questions
●
Area and Circumference of a
programmingwithbasics.com
●
Character Is Vowel or Consonant
●
A Character Is an Alphabet or Not
●
Uppercase, Lowercase, Speci
programmingwithbasics.com
●
Input all sides of a triangle and check whether the triangle is valid or not.
●
Check whether the
programmingwithbasics.com
3. For Loop Questions
●
Generate IP (Internet Protocol) Addresses Using
●
Print Multiplication Tabl
programmingwithbasics.com
5. Array Questions
●
Insert An Element Desired or Specific Position In An Array
●
Remove Duplicates
programmingwithbasics.com
●
Sort array elements in ascending or descending order.
●
Sort even and odd elements of the array s
programmingwithbasics.com
●
Recommended posts
7. String Questions List
●
String Char-Case Change
●
A String is Palindrome or
programmingwithbasics.com
●
Count occurrences of a character in a given string.
●
Find the highest frequency character in a s
programmingwithbasics.com
●
Find the diameter, circumference and area of a circle using functions.
●
Maximum and minimum betw
programmingwithbasics.com
●
Strstr() Function (Sub-String)
●
Strlwr() Function (To Lower-Case)
●
Strupr() Function (To Upper-

You might also like