# C Programming Code Examples

## C > Mathematics Code Examples

This C Program to calculates the volume and surface area of cuboids. The Formula used in this program are surfacerea= 2(w * l + l * h + h * w) where w is Width & l is Length and h is

This C Program code calculates volume and surface area of cylinder. The formula used in this C Program 'Surface_area' = 2 * Pi * r * (r + h) & Volume = Pi * r * r * h where Pi = 22/7.

C Program calculates the volume and surface area of sphere. The formula used in this code Surface_area = 4 * Pi * r2, Volume = 4/3 * Pi * r3 where r is the radius of the sphere, Pi= 22/7

Generates fibonacci series. In fibonacci series the first 2 numbers in the Fibonacci sequence are 0, 1, each Subsequent Number is the sum of the previous two. Example 0, 1, 1, 2, 3, 5, 8,

Program to multiply given number by 4 using bitwise operators. C Program code multiplies given number by 4 using "Bitwise Operators". Bitwise Operators: or, and, xor, not, left shift,

Program code print Armstrong Number from 1 to 1000. An Armstrong number is an n-digit base b number such that the sum of its (base b) Digits Raised to the Power n is the number

C code Print the 'Factorial' of a given number. A factorial is product of all the numbers from 1 to n, where n is the 'specified number'. This C program find the product of all the number

C Program to read a coordinate point in a XY coordinate system & determine its quadrant. The program accepts X and Y. Depending on the Value of X & Y we need to Determine on

Take the Number which you have to Reverse as the input. Obtain its quotient & remainder. Multiply the separate variable with 10 & add the obtained remainder to it. Do step 2 again

Take the Number which you have to Reverse as the input. Obtain its quotient & remainder. Multiply the Separate variable with 10 & add the obtained remainder to it. Do step 2 again

This C Program simulates a simple calculator. Program performs arithmatic operations like addtion, subraction, multiplication & division. Assume that the two numbers a&b are given.

C Calculations on a table, the radius of table, the diameter of the table, the circumference of the table, the area of a circle, calculate the radius, calculate the circumference, calculate

Check Armstrong Number of n digits. In case of an Armstrong number of 3 digits, the sum of cubes of each digits is equal to the number itself. Example 407 = 4*4*4 + 0*0*0 + 7*7*7
Program to generate Fibonacci Sequence up to a certain number. The Fibonacci sequence is a series where the Next term is the Sum of Pervious 2 terms. The First Two terms of the
The "Positive Numbers" 1, 2, 3... are known as natural numbers. The C program codes below takes a positive integer ( let say n ) as an input from the user and calculates the sum up to n.
Program Print Armstrong Numbers between two Integers. In case of an armstrong number of 3 digits, the Sum of Cubes of each digits is equal to the number itself. For example: 407
The Factorial of a Positive Number n is given by: factorial of n (n!) = 1*2*3*4...n. Factorial of a negative number doesn't exist. And, the factorial of 0 is 1, 0! = 1. The program takes a
C Language calculateSD() function calculates the Standard Deviation. The array containing 10 elements is passed to the function and this function calculates the Standard Deviation &
The determinant tells the nature of the roots. b*b-4ac: Determinant of quadratic equation. If determinant is greater than 0, the roots are real and different. If determinant is equal to 0

Page 1 Page 2 Page 3 Page 4