🔒 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
  • 1K
    Views
  • 7
    Participants
Last reply from:
Xilent

Trending Topics

Online now

Members online
486
Guests online
1,942
Total visitors
2,428

Forum statistics

Threads
2,316,991
Posts
29,189,088
Members
1,182,190
Latest member
wiwiwuwu
Back
Top