We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e1867a0 commit ab1466eCopy full SHA for ab1466e
C++/6_digit_sum.cpp
@@ -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