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

Trending Topics

Online now

Members online
1,287
Guests online
1,188
Total visitors
2,475

Forum statistics

Threads
2,271,735
Posts
28,937,758
Members
1,237,834
Latest member
purplerakrak
Back
Top