# Tag Archives: Exercises

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

## Pointer programming exercises and solutions in C

Pointer is a variable that stores memory addresses. Unlike normal variables it does not store user given or processed value, instead it stores valid computer memory address.

## 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 as intermediate programmers. Practice more and more of it, to enhance your logical thinking.

Always feel free to drop down your queries and suggestions below in the comments section. I always love to hear from hugs and bugs from you.

Happy coding 😉

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

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

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

## 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).

## 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 logical thinking capabilities. As a novice programmer you must practice these patterns to get a good hands on logical thinking and program flow control.

In this exercise I have compiled a list of Star patterns to practice for beginners and intermediate programmers. I have tried my best to explain the logic of each pattern individually.

If you got stuck with some pattern or have some query or suggestion, always feel free to write it down below in the comments section. I always love to hear from you all.

## Loop programming exercises and solutions in C

In programming, there exists situations when you need to repeat single or a group of statements till some condition is met. Such as - read all files of a directory, send mail to all employees one after another etc. These task in C programming is handled by looping statements.

## Conditional operator programming exercises and solutions in C

Conditional operator is a ternary operator used to evaluate expression based on some condition. Conditional operator is a replacement of small if...else statements. It takes three operand conditional-expression, true-expression and false-expression It is also known as ternary operator, inline if, ternary if etc.