A special site for solving fun programming problems and challenges, interested in computer science, programming, basics, data structure and algorithms

 

Sum and Average of three numbers

Write a C++ Program to Find Sum and Average of three numbers. Here’s simple C++

 Program to Find Sum and Average of three numbers in C++ ProgrammingLanguage.


source code:

#include <iostream>

using namespace std;

int main()
{
    int A,B,C;
    cout<<"Enter the first number: ";
    cin>>A;
    cout<<"\nEnter the second number: ";
    cin>>B;
    cout<<"\nEnter the third number: ";
    cin>>C;
    cout<<"\nSum is: "<<A+B+C<<endl;
    cout<<"\nAverage is: "<<(A+B+C)/3<<endl;

    return 0;
}
The End

No comments:

Post a Comment