In this C-program we will scan the numbers using array and then we will calculate the sum of the given numbers, also using array. The numbers will be taken from the user.color>
input:
5 numbers.(i.e : 5,6,9,56,548)output:
The sum of the given numbers will be printed on the screen.CODE---->
#include
#include
{
int arr[5],i,sum=0;
printf(" Enter Five numbers : color>");
for(i=0color>;icolor>;i++color>)
{
scanf("%dcolor>",&arr[i]);
}
for(i=0color>;icolor>;i++color>)
{
sum=sum+arr[i];
}
printf("\n The sum of the given 5 numbers is : %d\ncolor>",sum);
system("pausecolor>");
}
color>