What's new

C & C++ Mga sir pa help

Ldreedz

Forum Veteran
Elite
Joined
Feb 24, 2019
Posts
2,410
Reaction
1,136
Points
686
Age
22
Mga idol na magagaling sa programming pa help naman po dito kung paano po ito ma code sa c++ language super noob po talaga ako sa programming
IMG_20210712_151703.JPG
IMG_20210712_151641.JPG
 

Attachments

[CODE lang="cpp" title="Ganto ?"]#include <iostream>

using namespace std;

char Name[128];
int birthyear;
int main()
{
cout<<"Please Enter Your Name: ";
cin >> Name;
cout<<"Please Enter Year of Birth: ";
cin >> birthyear;
cout << endl;

cout<<"Hello there, " << Name <<" !"<<endl;
cout<<"--------------------------"<<endl;

int age = 2021 - birthyear;

cout<<"|You are now "<<age<<" years old|"<<endl;
cout<<"--------------------------"<<endl<<endl;

cout<<"============Thank You========"<<endl;
return 0;
}
[/CODE]
[CODE lang="cpp" title="area of triangle"]#include <iostream>

using namespace std;

double base;
double height;
int main()
{
cout<<"======================================="<<endl<<endl;
cout<<" --- COMPUTE THE AREA OF THE TRIANGLE ----"<<endl;
cout<<"What is the length of base of the triangle? ";
cin >> base;
cout<<"What is the length of height of the triangle? ";
cin >> height;
cout << endl <<endl;


double area = (base * height) / 2;

cout<<"The are of the triangle is: "<< area << "." <<endl<<endl<<endl;

cout<<"============Thank You========"<<endl;
return 0;
}
[/CODE]

di ako programmer sana makatulong ^^
 
Last edited:

Similar threads

Back
Top