#include<stdio.h> #include<conio.h> void main() { int i,a[50],sum,n; printf(" Enter no of elements :"); scanf("%d",&n); /* Reading values into Array */ printf(" Enter the values :"); for(i=0;i < n;i++) scanf("%d",&a[i]); /* computation of total */ sum=0; for(i=0;i < n;i++) sum=sum+a[i]; /* printing of all elements of array */ for(i=0;i < n;i++) printf("n a[%d]=%d",i,a[i]); /* printing of total */ printf(" sum=%d",sum); getch(); }
About Me
- Amit Singh Thakur
- Raipur, Chhattisgarh, India
- Hi , I am Amit Thakur. I have worked as a QA Engineer for two years and as a Java Developer for one year in NIHILENT TECHNOLOGIES PVT. LTD., Pune.Currently I am working as DEAN (Research & Development) in Bhilai Institute of Technology, Raipur.
Monday, September 2, 2013
C Program to Read Array Elements
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment