C++ program for adding 10 numbers

 #include <iostream>

int main() {

    int sum = 0;


    std::cout << "Enter 10 numbers:\n";


    for (int i = 1; i <= 10; ++i) {

        int number;

        std::cout << "Number " << i << ": ";

        std::cin >> number;

        sum += number;

    }


    std::cout << "The sum is: " << sum << std::endl;


    return 0;

}






Comments

Popular posts from this blog

MAIL MERGE IN PAGEMAKER

Paste Special in MS-Excel

How to use Whatsapp on your Computer?