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 …

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 …

C Program to Evaluate sin(x) Taylor Series

The sine function can be computed from scratch using its Taylor series expansion: sin(x) = x − x³/3! + x⁵/5! − x⁷/7! + x⁹/9! − … Each term alternates in sign and uses an odd power of x divided by the corresponding factorial. As you add more terms, the partial sum converges toward the true …

C Program to accept two integers for a co-ordinate point and determine its Quadrant.

The Cartesian coordinate plane is divided into four quadrants by the X and Y axes. Given a point (x, y), this program determines which quadrant it lies in — or whether it falls on an axis or at the origin. The logic is a direct translation of the mathematical definitions into C’s if-else chain. Region …

Prime Number Program in C – Check if a Number is Prime

A prime number program in C checks whether a given integer is prime — divisible only by 1 and itself. Numbers like 2, 3, 5, 7, 11, and 13 are prime; 4, 6, 9, and 12 are not. This page covers two approaches: a basic trial division and an optimized version that skips even numbers, …