C Program to Find the Area of a Circle Given the Radius

The area of a circle is A = π r² and the circumference is C = 2πr, where r is the radius. This program computes both from a user-supplied radius. Key points: use radius * radius instead of pow(radius, 2) (no need for the math library for a simple square), define π as a high-precision …

C Program To Swap Two Variables

Swapping two variables is one of the most common operations in sorting, data structure manipulation, and algorithm implementation. There are three standard methods: using a temporary variable (clearest), arithmetic (no temp, but overflow risk), and XOR bit manipulation (no temp, no overflow, but tricky for same-variable self-swap). All three produce the same result — understanding …

Numbers Divisible by 7 in C – List, Count, and Sum

Finding all integers in a range that are divisible by a given number is a classic loop exercise. The key tool is the modulo operator % — if i % 7 == 0, then i is exactly divisible by 7 with no remainder. This post shows two programs: one for the classic 100–200 range, and …

C Program to Find the Sum of Even and Odd Numbers

Given a list of integers, separate them into two groups — even numbers (divisible by 2) and odd numbers (not divisible by 2) — and report the sum and count of each group. This is a classic array-scanning problem that demonstrates the modulo operator, accumulator variables, and loop-based input. The original post had no code; …

String Concatenation in C – Custom Function and strcat

String concatenation in C joins two strings end-to-end into a single result. The standard library provides strcat() for this, but writing it manually teaches how C strings work: they are null-terminated char arrays, and concatenation means walking to the end of the destination string then copying source characters one by one until the null terminator. …

C Program to find the squares and cubes of a two digit odd number.

This C program prints the square and cube of every two-digit odd number — that is, the odd numbers from 11 to 99. A number is odd if it is not divisible by 2 (n % 2 != 0). Two-digit odd numbers begin at 11 (the smallest two-digit odd) and end at 99. The original …