Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream.h>
- #include<conio.h>
- void main()
- {
- int i, n, sum=0, a[100];
- clrscr();
- cout<<"Enter number of element of array;"<<endl;
- cin>>n;
- for(i=0; i<n; i++)
- {
- cout<<"a["<<i+1<<"]=";
- cin>>a[i];
- sum=sum+a[i];
- }
- cout<<"sum of the inputted number="<<sum<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment