File handling exercises and solutions in C

Files are used to store data permanently on hard disk. C programming supports built in library function to interact with files and directories. I have compiled a list of file handling exercises with solution for beginners and intermediate programmers.

Read more

Number pattern programs in C

Number pattern is a series of numbers arranged in specific order. These patterns are patterns created by numbers and are similar to star patterns. They are best suited to enhance your logical thinking abilities and to practice flow control statements. I have assembled a list of number patterns to practice for both novice as well … Read more

Function, recursion programming exercises and solutions in C

A function is a collection of statements grouped together to do some specific task. In series of learning C programming, we already used many functions unknowingly. Functions such as – printf(), scanf(), sqrt(), pow() or the most important the main() function. Every C program has at least one function i.e. the main() function.

Function provides modularity to our program. Dividing a program in different modules makes it easy to maintain, debug and understand the code.

Read more

Bitwise operator programming exercises and solutions in C

Data in the memory (RAM) is organized as a sequence of bytes. Each byte is a group of eight consecutive bits. Bitwise operators are useful when we need to perform actions on bits of the data.

C supports six bitwise operators.

  1. Bitwise AND operator &
  2. Bitwise OR operator |
  3. Bitwise XOR operator ^
  4. Bitwise complement operator ~
  5. Bitwise left shift operator <<
  6. Bitwise right shift operator >>

This exercises focuses on mastering bitwise operators. After this exercise you will surely gain some confidence using bitwise operators.

Read more

String programming exercises and solutions in C

Strings are basically array of characters that represent some textual data in a program. Here are basic string programs with detailed explanation that will help to enhance your string programming skills. These exercises can be practiced by anyone a beginner or an intermediate programmers.

Read more

Array and Matrix programming exercises and solutions in C

Array is a linear data structure that hold finite sequential collection of homogeneous data. We can store a collection of values in an array.

Array uses an integer value index to access a specific element. Index starts from 0 and goes till N-1 (where N is the size of array).

Read more

Star patterns in C programming

Star patterns are a series of * or any other character used to create some pattern or any geometrical shape such as – square, triangle(Pyramid), rhombus, heart etc. These patterns are often prescribed by many programming books and are best for practicing flow control statement. Many programmers around world extremely recommended pattern problems, to enhance … Read more