C Program to Find the Sum of First 50 Natural Numbers using For Loop

This is a C Program to find the sum of first 50 natural numbers using for loop. Problem Description This C Program finds sum of first 50 natural numbers using for loop. Problem Solution It displays the sum of first 50 natural numbers as output. Program/Source Code Here is source code of the C program … Read more

advertisement

C Program to Find Volume and Surface Area of a Cube

This is a C Program to compute the surface area & volume of a cube. Problem Description This C Program computes the surface area & volume of a cube. Problem Solution The formula used to find the surface area and volume of the cube is surface_area = 6 * (a * a) and volume = … Read more

advertisement

C Program to Find GCD and LCM of Two Integers

GCD (Greatest Common Divisor) GCD stands for Greatest Common Divisor. GCD of two numbers is the largest positive integer that completely divides both the given numbers. Example: GCD(10,15) = 15, GCD(12,15) = 3. LCM (Least Common Multiple) LCM stands for Least Common Multiple. It is a method to find the lowest common multiple between the … Read more

advertisement

Prime Number Program in C

What is Prime Number in C? A prime number is a natural number that is greater than 1 and is only divisible by 1 and itself. In other words, no number except the number itself, and 1 can divide a prime number. Example: 2, 3, 5, 7, 11, 13, 17, 19 …., etc. Problem Description … Read more

advertisement

Sum of First N Natural Numbers in C

Problem Description: Write a C program to find the sum of first n natural numbers. What is a Natural Number? Natural numbers are all positive integers ranging from 1 to n or infinity. Sum of first n natural number, for any number n, sum is defined as 1+2+3—-n, which is an arithmetic series whose sum … Read more

advertisement

C Program to Find the Roots of a Quadratic Equation

Roots of a Quadratic Equation in C: The roots/Solutions of the quadratic equation ax2 + bx + c = 0 are the values of the variable x that satisfy the equation. This means finding the value of x such that the whole equation sums to 0. Because the degree (*HIGHEST POWER OF A VARIABLE) of … Read more

advertisement

Calculator Program in C

A calculator is a device used to perform mathematical operations on numbers. Simple calculators can only perform the basic mathematical operations of addition, subtraction, multiplication, and division. In this article, we will explain a simple calculator program in C with an example. Problem Solution 1. Declare the variables. 2. Get the two numbers from the … Read more

advertisement

C Program to Calculate the Sum of cos(x) Series

This is a C Program to calculate the sum of cos(x) series. Problem Description This C Program calculates the sum of cos(x) series. Problem Solution Take input from the user and perform operations as shown in the program below. Program/Source Code Here is source code of the C program to C Program calculates the sum … Read more

advertisement

C Program to Find First N Fibonacci Numbers

This C Program calculate the Fibonacci numbers in the series. The first two numbers in the Fibonacci sequence are 0 and 1 and each subsequent number is the sum of the previous two. The formula for this program is: Fn = Fn-1 + Fn-2 Here is source code of the C program to calculate the … Read more

advertisement

C Program to Calculate Pow (x,n)

This is a C Program to compute the value of x ^ n. Problem Description This C Program computes the Value of X ^ N. Problem Solution The program uses power function defined in math library. Program/Source Code Here is source code of the C program to computes the Value of X ^ N. The … 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.