0% found this document useful (0 votes)
2 views

Programs for Practice

The document outlines various programming exercises and questions categorized into different topics such as simple C questions, if/else statements, loops, arrays, matrices, strings, functions, pointers, file handling, sorting, and searching. Each category contains specific problems to solve, ranging from basic calculations to more complex data manipulations. This comprehensive list serves as a resource for practicing and enhancing programming skills in C.

Uploaded by

vinod.pq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Programs for Practice

The document outlines various programming exercises and questions categorized into different topics such as simple C questions, if/else statements, loops, arrays, matrices, strings, functions, pointers, file handling, sorting, and searching. Each category contains specific problems to solve, ranging from basic calculations to more complex data manipulations. This comprehensive list serves as a resource for practicing and enhancing programming skills in C.

Uploaded by

vinod.pq
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Programs for Practice

1. Simple C Questions
● Area and Circumference of a Circle

● Print Ascii Value of the Character

● Area of Triangle

● Convert a Person’s Name into an Abbreviated

● Simple Interest

● Gross Salary of an Employee

● Percentage of 5 Subjects

● Converting Temperature Celsius into Fahrenheit

● The Display Size of the Different Data Types

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

● 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 a 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 the week number and print the weekday.

● 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

1. While Loop or While-Do Loop Questions

● Reverse A given Number

● Find Number Is Armstrong Or Not

● Calculate the Sum of Natural Numbers

● Display Fibonacci Series

● Find the LCM of two Numbers

● Reverse a Number

● Check Whether a Number is A Palindrome or Not

● Count the Number of Digits of an Integer

● Find A Generic Root Of the 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 the 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 the Radius, Circumference and Volume of the Cylinder

● Remove All Vowels From A String

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

● Print the total number of days in a month using a 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 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

● 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 the 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 the 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 the 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 the case of each character of a string.

● Find the total number of alphabets, digits or special characters 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 the 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 occurrences 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 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.

● 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 the 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 the factorial of any number using recursion.

● Generate nth Fibonacci term using recursion.


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

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

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 matrices using pointers.

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

● Append content to a file.

● Compare two files.

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

● Merge two files into 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 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
● 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

You might also like