0% found this document useful (0 votes)
31 views1 page

Day5 Pgms

The document contains two C programs that take integer input from the user and store it in arrays, then output the array elements or sum of array elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views1 page

Day5 Pgms

The document contains two C programs that take integer input from the user and store it in arrays, then output the array elements or sum of array elements.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

1.#include <stdio.

h>

int main(void) {
int a[5],i;
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<5;i++)
{
printf("%d\t",a[i]);
}

return 0;
}

2. #include <stdio.h>

int main(void) {
int a[5],i,sum=0;
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("%d",sum);

return 0;
}

You might also like