🔒 Closed C++ only

Status
Not open for further replies.

PHC-Young

Eternal Poster
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.

About this Thread

  • 9
    Replies
  • 991
    Views
  • 7
    Participants
Last reply from:
Xilent

Trending Topics

Online now

Members online
431
Guests online
5,654
Total visitors
6,085

Forum statistics

Threads
2,281,821
Posts
29,004,138
Members
1,224,622
Latest member
javiergpnzalez
Back
Top