TutorialsLink
HomeExplore ArticlesCategories
Sign In / Sign Up
⚡Know more FullForms Free !
MCQsCode SnippetsE-BooksVideos
Home/Explore Articles/Program to calculate sum of first N natural numbers.
C Programming

Program to calculate sum of first N natural numbers.

Nikhil Juneja

Nikhil Juneja

Apr 25, 20183 min read19 views
#C Programming#Sum#Natural Numbers#N Natural Numbers#Sum Of Natural Numbers
Download Source Code
Program to calculate sum of first N natural numbers.
#include <stdio.h>
 
int main()
{
    int n,i;
    int sum;
 
    printf("Enter the value of N :");
    scanf("%d",&n);
 
    sum=0;
 
    for(i=1;i< n;i++)
        sum+=i;
 
    printf("\nSum is = %d",sum);
     
    return 0;
}

Nikhil Juneja
Written by

Nikhil Juneja

View Profile

Passionate software developer and technical contributor at TutorialsLink.

Related Articles

Explore

How to build a Simple Browser in Python

Nov 18, 2023

HTML Favicon

Jan 3, 2022

HTML - JavaScript - button to Display Date and Time

Jan 3, 2022

C# program to create a new thread

Dec 28, 2021

Program to Find all Roots of a Quadratic Equation | Kotlin

Oct 26, 2021

Program to Reverse a Number | Kotlin

Aug 8, 2021
TutorialsLink

Knowledge Shared. Technology Advanced. A modern developer community for technical articles, cloud architecture guides, interview MCQs, and practical tutorials.

Connect

Platform

  • About Us
  • Contact Us
  • Privacy Policy
  • Become An Author
  • MVB Portal
  • 10 Years Celebration 🎉

Explore

  • Explore Articles
  • Categories & Library
  • Free MCQ Papers
  • Code Snippets
  • Full Forms (A-Z)
  • Shortcut Keys

Newsletter

Get weekly engineering tutorials, cloud guides, and developer insights.

Tech NewsVideosE-Books

© 2026 TutorialsLink. All rights reserved.

Sitemap•RSS Feed•Privacy Policy•About Us•Contact Us