In this C program, you will learn how to reverse the number entered by the user. Below is a simple C program example to reverse a given number. C Program to Reverse a Number (Integer) #include <stdio.h> int reversDigits(int num) { int rev_num = 0; while (num > 0) { rev_num = rev_num * 10 […]

# C

## Sum of Digits Program in C of a given Number

In mathematics, the sum of digits a natural number in a given number base is the sum of all its digits. For example, the sum of digits for the decimal number 9045 would be 9+0+4+5=18 Algorithm for sum of digits in a given number: Get the number Declare a variable to store the sum and […]

## C Program to Check Armstrong Number

Before writing the the C program to check Armstrong Number, lets see what is Armstrong number. An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For Example, 153, 371 are Armstrong number. Lets see why 153 = (1)3 + […]

## Factorial Program in C

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n: For example, 5! = 5*4*3*2*1 = 120 3! = 3*2*1 = 6 The factorial is normally used in Permutations and Combinations. There are multiple ways to write the factorial […]

## C Program to Check Whether a Number is Palindrome or Not

A palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed. In other words, it has reflectional symmetry across a vertical axis. The term palindromic is derived from palindrome, which refers to a word (such as rotor or […]

## C Program to Check Whether a Number is Prime or Not

A prime number is a whole number greater than 1 that can only be divided by itself and 1. A prime number is a natural number that has only one and itself as factors. Prime number examples: 2, 3, 5, 7, 11, 13, 17, 19, 23 are few prime numbers. Prime Number Check Program in C /* Title: Prime Number Program in C Author: […]