Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- int num,somma,i,n2;
- int main()
- {
- i=0;
- somma=0;
- cout<<"quanti numeri vuoi inserire?"<<endl;
- cin>>n;
- while(i<n)
- {
- cout<<"inserisci il numero"<<endl;
- cin>>num;
- somma=num+somma;
- i++;
- }
- cout<<"la somma è"<<somma<<endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement