top of page
Wave
Cactus%20Plant_edited.jpg

SUM OF N NUMBER 

#include<stdio.h>
int main()
{
    int a[100],s=0,n,i;
    printf("How many number you want to sum: ");
    scanf("%d",&n);
    printf("\n");
    for(i=0;i<n;i++)
    {
        printf("a[%d]= ",i+1);
        scanf("%d",&a[i]);
        s=s+a[i];
    }
    printf("\nThe sum is %d\n",s);
    return 1;
}

Subscribe Form

Thanks for submitting!

  • Facebook
  • YouTube
  • Instagram
  • Twitter

©2020 by Abhisek Midya ( A18 )

bottom of page