/ Undifined / 20 - WAP that simply takes elements of the array from the user and finds the sum of these elements

20 - WAP that simply takes elements of the array from the user and finds the sum of these elements

WAP that simply takes elements of the array from the user and finds the sum of these elements
#include<stdio.h> 
#include<conio.h>
void main()
{
int a[5],i,sum;
float avg=0.0;
printf("Enter the elements of array");
for(i=0;i<5;i++)
scanf("%d" ,&a[i]);
sum=a[0]+a[1]+a[2]+a[3]+a[4];
printf("\n The sum of array is %d " ,sum);
getch();
}

about author

Blogger Sens it website about blogger templates and blogger widgets you can find us on social media
Previous Post :Go to tne previous Post
Next Post:Go to tne Next Post

No comments:

Post a Comment