diff --git a/exercises/sum.cpp b/exercises/sum.cpp index 0dcca93..9695105 100644 --- a/exercises/sum.cpp +++ b/exercises/sum.cpp @@ -1,8 +1,21 @@ -/* - Write a program that takes as input two numbers and print the sum. +#include + +int main() +{ + int somma; + int num1; + int num2; + + printf("Inserisci il primo valore: "); + scanf("%d", &num1); + + printf("Inserisci il secondo valore: "); + scanf("%d", &num2); + + somma = num1 + num2; + + printf("La somma dei due numeri e' la seguente: %dn", somma); +return 0; +} - Output: - Insert the first number: 1 - Insert the second number: 2 - Sum: 3 -*/ + \ No newline at end of file