Advertisement
Guest User

Untitled

a guest
Dec 14th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int num,somma,i,n2;
  4. int main()
  5. {
  6. i=0;
  7. somma=0;
  8. cout<<"quanti numeri vuoi inserire?"<<endl;
  9. cin>>n;
  10. while(i<n)
  11. {
  12. cout<<"inserisci il numero"<<endl;
  13. cin>>num;
  14. somma=num+somma;
  15. i++;
  16. }
  17. cout<<"la somma è"<<somma<<endl;
  18. system("pause");
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement