What's new

Closed C++ only

Status
Not open for further replies.

PHC-Young

Eternal Poster
Joined
Jul 14, 2016
Posts
1,160
Reaction
477
Points
391
Create a program in C++ using structure
Create a program in C++ using function(1. Area of Trapezoid 2. Volume of Sphere 3. Perimeter of Rhombus).
Baka may makatulong sakin sa pag cocode. nid ko lang po talaga . :)

HELP ! HELP ! HELP ! HELP !
Mga master dyan sa Coding baka naman pwede nyu akong matulungan xD
 
#include <iostream>

using namespace std;



struct math{

float a,b,h,ans;

};

void AreaOfTrapezoid(){

math value1,value2,value3,answer;
float a,b,h,area;

a = value1.a;
b = value2.b;
h = value3.h;
area = answer.ans;

cout<<"Area of TRAPEZOID"<<endl;
cout<<"Enter first value: ";
cin>>a;
cout<<"Enter second value: ";
cin>>b;
cout<<"Enter third value: ";
cin>>h;
a = a + b;
h = h* a;
area = h * 0.5;
cout<<" \tArea of trapezoid = "<<area <<" m^2"<<endl;

}

int main()
{
AreaOfTrapezoid();
return 0;
}


Ganito po ba?
 
#include <iostream>

using namespace std;



struct math{

float a,b,h,ans;

};

void AreaOfTrapezoid(){

math value1,value2,value3,answer;
float a,b,h,area;

a = value1.a;
b = value2.b;
h = value3.h;
area = answer.ans;

cout<<"Area of TRAPEZOID"<<endl;
cout<<"Enter first value: ";
cin>>a;
cout<<"Enter second value: ";
cin>>b;
cout<<"Enter third value: ";
cin>>h;
a = a + b;
h = h* a;
area = h * 0.5;
cout<<" \tArea of trapezoid = "<<area <<" m^2"<<endl;

}

int main()
{
AreaOfTrapezoid();
return 0;
}


Ganito po ba?
Salamat dito pero tapos ko na po e.
 
Status
Not open for further replies.

Similar threads

Back
Top