Skip to content

Commit 8cc3eb9

Browse files
committed
feat: file con funzione somma
1 parent f8f4676 commit 8cc3eb9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

sum.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <iostream>
2+
using namespace std;
3+
4+
int sum(int a, int b){
5+
return a+b;
6+
}
7+
8+
int main(){
9+
10+
int x;
11+
int y;
12+
int result=0;
13+
14+
cout << "Inserisci il primo numero: " ;
15+
cin >> x;
16+
17+
cout << endl;
18+
19+
cout << "Inserisci il recondo numero: " ;
20+
cin >> y;
21+
22+
cout << endl;
23+
24+
result=sum(x,y);
25+
cout << "Somma: " <<x << "+" <<y << "=" <<result<< endl;
26+
27+
return 0;
28+
}

0 commit comments

Comments
 (0)