C Program to multiply given number by 4 using bitwise operators

C Program to multiply given number by 4 using bitwise operators. Bitwise operators allows to cahnge or edit the specific bits within an integer. Program will multiply a given number by 4 using left shift(<<) bitwise operator. Read more about C Programming Language . /************************************************************ You can use all the programs on www.c-program-example.com* for personal …

C Program to read an English sentence and replace lowercase characters by uppercase and vice-versa.

This program reads a sentence and swaps the case of every letter — uppercase becomes lowercase, lowercase becomes uppercase. Digits, spaces, and punctuation are left unchanged. The <ctype.h> functions isupper(), islower(), toupper(), and tolower() make this clean and portable across all ASCII and extended character sets. The original post used conio.h, void main(), a broken …

C program to input real numbers and find the mean, variance and standard deviation

Given N real numbers, this program computes three fundamental descriptive statistics: the mean (arithmetic average), the variance (how spread out the values are from the mean), and the standard deviation (the square root of variance — in the same units as the data). These are the first three statistics taught in any probability or data …

C program to find the sum of ‘N’ natural numbers.

The natural numbers are the positive integers: 1, 2, 3, 4, 5, … Their sum from 1 to N can be computed two ways: a simple loop that adds each number, or the Gauss formula N×(N+1)/2 that gives the answer in O(1) time without any loop. This post shows both, explains why the formula works, …

C Program to Check Whether a Given Integer is Positive or Negative

A number is positive if it is greater than zero, negative if it is less than zero, and zero is neither. This is one of the most fundamental checks in programming — it shows up in input validation, physics simulations, financial calculations, and signal processing. This program handles all three cases with a clear if-else …

C Program to Check Whether a Given Integer is Odd or Even

An integer is even if it is divisible by 2 with no remainder, and odd if dividing by 2 leaves a remainder of 1. Zero is even. Negative integers follow the same rule: −4 is even, −7 is odd. This program uses the modulo operator % to determine parity in a single if-else check. Number …