Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //value and sum finding
- #include <iostream.h>
- #include <conio.h>
- void main()
- {
- int a[5];//variable declaration
- int n=0;//value in an array
- clrscr();
- while(cin>>a[n]){
- n++;
- }
- int sum=0, i;
- for(i=0; i<n; i++)
- sum=sum+a[i];
- cout<<sum<<endl;
- getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment