Armstrong Number in C

What is Armstrong Number? An Armstrong Number in C is an n-digit base b number, where the sum of its (base b) digits raised to the power n equals the number itself. Examples of Armstrong numbers include 0, 1, 153, 370, 371, 407, etc. Armstrong Number Formula: wxyz = pow(w,n) + pow(x,n) + pow(y,n) + … Read more

advertisement

C Program to Check Whether a Given Number is Perfect Number

A perfect number is a number that is equal to the sum of its proper divisors. For example, the divisors of 6 are 1, 2 and 3. The sum of the proper divisors of 6 is 1 + 2 + 3 = 6, which is a perfect number. The sum of the proper divisors of … Read more

advertisement

C Program to Find Nth Fibonacci Number using Recursion

This C Program prints the fibonacci of a given number using recursion. In fibonacci series, each number is the sum of the two preceding numbers. Eg: 0, 1, 1, 2, 3, 5, 8, … The following program returns the nth number entered by user residing in the fibonacci series. Here is the source code of … Read more

advertisement

C Program to Find the Factorial of a Number using Recursion

This is a C Program to find the factorial of a number using recursion. Problem Description This C Program Finds the Factorial of a Number using Recursion. Problem Solution This C Program prints the factorial of a given number using recursion. A factorial is product of all the number from 1 to the user specified … Read more

advertisement

C Program to Display Armstrong Number between Two Intervals

Armstrong Number in C: A n-digit number is said to be an Armstrong number or Narcissistic number if the sum of its digits raised to the nth power equals the number itself. Sequence of Armstrong numbers are: 1,2,3,4,5,…..,9,153….. etc. Example: 153 (n=3) because 13 + 53 + 33 = 1 + 125 + 27 = … Read more

advertisement

C Program to Find Area of Parallelogram

This is a C Program to Find Area of Parallelogram. Problem Description This C Program calculates the area of Parallelogram. Problem Solution The formula used in this program are Area = b * a where b is the length of any base, a is the corresponding altitude. Program/Source Code Here is source code of the … Read more

advertisement

C Program to Find Sum of Series 1^2 + 2^2 + …. + n^2

This is a C Program to find the sum of series 1^2 + 2^2 + …. + n^2. Problem Description This C Program calculates the Sum of Series 1^2 + 2^2 + …. + n^2. Problem Solution Then the Sum of the series 1^2 + 2^2 + …. + n^2 = n(n + 1)(2n + … Read more

advertisement

C Program to Find LCM of Two Numbers

Problem Description Write a C program to find the LCM of two numbers. What is LCM (Least Common Multiple)? LCM stands for Least Common Multiple. It is a method to find the lowest common multiple between the two numbers. LCM of two numbers is the lowest possible number that is divisible by both numbers. Examples: … Read more

advertisement

C Program to Print Diamond Pattern

Pattern problems are one of the most common problems encountered by programmers. This article contains a diamond pattern problem in C with its proper approach, algorithm and codes. Problem Description Write a C program that prints a diamond pattern upon receiving number of rows as input. Problem Solution Algorithm: 1. Take the number of rows … Read more

advertisement

C Program to Find GCD of Two Numbers using Recursion

This is a C Program to find gcd of given numbers using recursion. Problem Description This C program, using recursion, finds the GCD of the two numbers entered by the user. Problem Solution The user enters two numbers by using a space in between them or by pressing enter after each input. Program/Source Code Here … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.