Answer:
#include <iostream>
using namespace std;
int main()
{
int side1=0;
int side2=0;;
int side3=0;
cout <<"Enter side one measurement";
cin >> side1;
cout <<"Enter side two measurement";
cin >> side2;
cout <<"Enter side three measurement";
cin >> side3;
if(side1+side2>side3||side1+side3>side2||side2+side3>side1){
if (side1==side2 && side2==side3)
{
cout <<"equilateral triangle"<<endl;
}
else if(side1==side2||side2==side3||side1==side3){
cout <<"Isosceles triangle"<<endl;
}
else{
cout <<"scalene triangle"<<endl;
}
}else{
cout<<"No triangle";
}
return 0;
}
Explanation:
The code is written in c++. It takes measurements of each side from users as input and check the types of triangle based on the following formula.
1. Equilateral Triangle
If all sides of a triangle are equal than it's an equilateral triangle.
2. Isosceles Triangle
If any two sides of a triangle are equal than it's an Isosceles triangle.
3. Scalene Triangle
If all the sides of a triangle are of different length than it's an Scalene triangle.
In a triangle the sum of two sides is greater than third side otherwise it's not a triangle.
What are u making it about?
Answer:
#include <iostream>
using namespace std;
int main()
{
char fullname[30];
string fname="",lname="";
int i,j;
cout<<"Enter fullname\n";
cin.getline(fullname,30); //so that blank can be read
for(i=0;fullname[i]!=' ';i++)
fname+=fullname[i]; //fistname will be saved
cout<<"\n";
for(j=i;fullname[j]!='\0';j++)
lname+=fullname[j]; //lastname will be saved
cout<<"\nFirstname : "<<fname<<"\nLastname : "<<lname;
return 0;
}
OUTPUT :
Enter fullname
John thomson
Firstname : John
Lastname : thomson
Explanation:
cin.getline() should be used instead of cin in case of strings so that space can be read otherwise after blank string will be ignored.
No because u ain’t put the question up here for someone to answer
Answer:
Option 3 - Type the title, highlight the text, select the underline command, and select the centering command.