Computer Science, asked by swapnilsen1908, 5 months ago

Write a program in Turbo C++ to Enter any 10 numbers and print the sum of only the numbers with 2 digits

Answers

Answered by kushal4468
1

Answer:

#include<iostream>

using namespace std;

int main() {

int x, s = 0;

cout << "Enter the number : ";

cin >> x;

while (x != 0) {

s = s + x % 10;

x = x / 10;

}

cout << "\nThe sum of the digits : "<< s;

}

Explanation:

Enter the number : 236214828

The sum of the digits : 36

hope this help you

Similar questions