Monday, August 8, 2016

Find Area of Rhombus in C++

A simple program that I wrote using C++ to find the are of the Rhombus. The code is very easy to understand and use.

Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing


#include <iostream>
#include <iomanip>

using namespace std;

int main()
{

    float diag_1,diag_2;

    float area=0.00;

    cout << "\t Find Area of Rhombus";
    cout << "\n\n";
    cout << "Enter diagonals of the given rhombus : ";
    cin >> diag_1 >> diag_2;

    area = (0.5 * diag_1 * diag_2);

    cout << "\n\n";
    cout << setprecision(5);
    cout <<"The Area of Rhombus is " << area<<".";
    cout << "\n\n";
    cout << "End of Program";
    cout << "\n\n";

}




No comments:

Post a Comment