repl.it
@SylvianBryan/

Array Add numbers from 1-50

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stdio.h>

int main(void) 
{
 int sum, i,j;
  sum=0; 
  for (i=0;i<=10;i++)
  scanf("d",&a [1]); 
  for (i=0;i<=10,i++)
  sum=sum+a[1];
  for (j=0;j<=10;j++)
  printf ("d", a [i]); 
  printf ("sum of the elements is &d",sum); 
  
  return 0;
}