STUDENTS 3K

  • Home
  • Students+
    • Engineering Students
    • Education Loan
    • Study Abroad Guide
    • Projects Download
  • Freshers
    • Aptitude Q & A
    • Placement Papers
    • Verbal Ability
    • Interview Questions
    • IT Company Details
    • Job Updates
  • Study Resources
    • Career Guidance
    • LAB Programs
      • C Programs
      • CPP Programs [C++]
      • Java Programs
    • Question Papers
    • Learn English
    • Notice Board
  • More –>>
    • Love calculator
You are here: Home / Important Programs / Sum of N numbers using Array in C

Sum of N numbers using Array in C

C program  for Sum of N numbers using Array technique. This simple C source code is coming under the part of C beginners guide. This sample code can be used for an Engineering, Diploma and all kind of Degree students and professionals.

  • C program to calculate sum & average of N numbers using Array

Sum of 10 numbers using Array

Sum of N numbers using Array in C program is used to calculate the value of array 10 numbers and it will display a sum value by using a looping statement (for loop). Basic formula is (sum=sum+a[i]).

[Read: Education Loan Guide] & [Study Abroad Details]

WRITE A C PROGRAM:

/* Title: Sum of N numbers using Array
Author: Vinoth Selvaraj
© http://students3k.com
*/
//Header files
# include <stdio.h>
# include <conio.h>

void main()
{
//Program variable
int b[10],s,j,su=0;

clrscr(); //Function is used to clear previous output
for (j=1;j<=10;j++) //Looping statement
{
printf("ENTER THE NUMBER::---"); //Display function
scanf("%d",&b[j]);//Getting input function
}
for(j=1;j<=10;j++)
b[j]=b[j]*b[j];
for(j=1;j<=10;j++)
printf("\nthe numbers are %d",b[j]);
for(j=1;j<=10;j++)
su=su+b[j];
printf("\n THE SUM OF 10 NUMBERS ARE %d",su);
getch();
}

Filed Under: Important Programs Tagged With: C, LAB, Programs





Random Materials :

  • Data Mining and Data Warehousing
  • Difference Between Class and Primitive Types
  • Database Roles in SQL
  • CASE Expression in SQL
  • Concurrent Update Problem

Follow Us on Facebook

Advertisement

Company Profile

  • About Students3k
  • Contact Us
  • Earn Money Online
  • Website Archive Page
  • Privacy Policy
  • Disclaimer

Categories

  • Important Programs
  • Study Abroad
  • IT Companies
  • Career Guidance for Students
  • Teachers
  • Verbal Analogies

We Are Social

  • Facebook Fans
  • Twitter Follow
  • Google Plus
  • Pinterest Page

© Copyright 2012 - 2016 Students3k.com · All Rights Reserved · Designed By Benefits

Show