Skip to content

Commit ab1466e

Browse files
committed
Added the solution of problem 6.
1 parent e1867a0 commit ab1466e

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

C++/6_digit_sum.cpp

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//Given 2 numbers N and M. Print thesum of lastdigit of both the numbers.
2+
3+
#include <iostream> //iostream is a header file which contains basic input/output functions.
4+
using namespace std;
5+
int main() {
6+
long long int N, M; //Declaring variables N and M as double.
7+
int sum;
8+
cin >> N >> M; //Taking input of N and M.
9+
sum = N%10 + M%10; //Taking the sum of last digit(i.e. remainder of division by 10)
10+
cout<<sum<<endl;
11+
return 0; //Return 0 to indicate that the program ended successfully.
12+
//End of program
13+
}
14+

0 commit comments

Comments
 (0)