• Free Template
  • Programming
    • Coding Guides
    • Articles
  • Tips & Tricks
  • Technology
  • What's Hot

c Examples

  • Introduction
  • Hello World
  • Calculation
  • Greatest Number
  • Armstrong Number
  • Multiplication Table
  • Perfect Number
  • Prime Number
  • Even Odd
  • Factorial
  • Fibonacci Series
  • Palindrome Number
  • Palindrome String
  • Temperature Converter
  • Recursive Factorial
  • Numeric Pyramid
  • Decimal to Binary
  • Decimal to Octal
  • Decimal to Hex
  • Binary to Decimal
  • Array Sum
  • Two Array Sum
  • LCM
  • GCD
  • Leap Year
  • Matrix Addition
  • Matrix Multiplication
  • Swapping
  • Binary Search
  • Linear Search
  • Bubble Sort
  • Insertion Sort
  • Selection Sort
  • Quick Sort
  • Merge Sort
  • Heap Sort
  • Write File
  • Read File
  • Copy File
  • Delete File
  • Singly Linked list
  • Doubly Linked list
  • Stack
  • Queue
  • Circular Queue
  • Binary Tree
  • Run Linux Command
  • Change Case

Apr 16, 2020

Array Sum

C Programming 563 views
#include<stdio.h>

int main() {

	/* Declaration of integer type array and initialize with 10 values */
	int array[ ] = {1,2,3,4,5,6,7,8,9,10};
	int ans = 0, i;
	for(i = 0; i < 10; i++)
		ans += array[i];
	printf("Sum of Array: %d\n",ans);
	return 0;
}



/* Output */
Sum of Array: 55

Array

Tags:
cc languagec programmingc coding for sum of array elementssum of array elements in cgeekboots tutorialgeekboots c programmingc code for sum of array elements
Author: Geekboots
Share On
Geekboots © 2022 About UsContact UsTermsCookie PolicyPrivacySubmit Article