Anybody know how to fix this?????????? [b]ERROR: 1>c:\cs 140\assignment 5\assignment 5\main.cpp(88) : fatal error C1075: end of file found before the left brace '{' at 'c:\cs 140\assignment 5\assignment 5\main.cpp(69)' was matched
void sidetype(int a, int b, int c)
{
if(a==b==c)
cout<<"Equilateral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isosceles Traingle\n";
else cout<<"Scalene Triangle\n";
}
void sortsides(int&a, int&b, int&c)
{ if (a>b)
swap(a, b);
if (b>c)
swap(b, c);
if (a>b)
swap(a, b);
}
void getsides(int&a, int&b, int&c)
{
cout<<"Enter side a: ";
cin>>a;
cout<<"Enter side b: ";
cin>>b;
cout<<"Enter side c: ";
cin>>c;
}
void swap (int&a, int&b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void triangle (int a, int b, int c)
{
if(a+b<c)
cout<<"Cannot form a triangle!";
if (b+c<a)
cout<<"Cannot form a triangle!";
if (a+c<b)
cout<<"Cannot form a triangle!";
}
void angletype (int a,int b,int c)
{
if((c*c)==((a*a) + (b*b)))
cout<<"Right";
if((c*c)>((a*a) + (b*b)))
cout<<"Obtuse";
if((c*c)<((a*a) + (b*b)))
cout<<"Acute";
}
int main()
{
int a, b, c;
getsides(a,b,c);
while(1)
{
if(a==0 && b==0 && c==0)
cout<<"Not a traingle "<<a<<" "<<b<<" "<<c<<endl;
break;
sortsides (a,b,c);
swap (a,b);
triangle(a,b,c);
{sidetype(a,b,c);
angletype(a,b,c);
}
return 0;
} getsides(a,b,c);
5 7243
void sidetype(int a, int b, int c)
{
if(a==b==c)
cout<<"Equilateral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isosceles Traingle\n";
else cout<<"Scalene Triangle\n";
}
void sortsides(int&a, int&b, int&c)
{ if (a>b)
swap(a, b);
if (b>c)
swap(b, c);
if (a>b)
swap(a, b);
}
void getsides(int&a, int&b, int&c)
{
cout<<"Enter side a: ";
cin>>a;
cout<<"Enter side b: ";
cin>>b;
cout<<"Enter side c: ";
cin>>c;
}
void swap (int&a, int&b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void triangle (int a, int b, int c)
{
if(a+b<c)
cout<<"Cannot form a triangle!";
if (b+c<a)
cout<<"Cannot form a triangle!";
if (a+c<b)
cout<<"Cannot form a triangle!";
}
void angletype (int a,int b,int c)
{
if((c*c)==((a*a) + (b*b)))
cout<<"Right";
if((c*c)>((a*a) + (b*b)))
cout<<"Obtuse";
if((c*c)<((a*a) + (b*b)))
cout<<"Acute";
}
int main()
{
int a, b, c;
getsides(a,b,c);
while(1)
{
if(a==0 && b==0 && c==0)
cout<<"Not a traingle "<<a<<" "<<b<<" "<<c<<endl;
break;
sortsides (a,b,c);
swap (a,b);
triangle(a,b,c);
{sidetype(a,b,c);
angletype(a,b,c);
} }
return 0;
} getsides(a,b,c);[/quote]
You have forgot to close the left brace in the end i have under line it for you
Let me know if it works now
No still doesnt work
int main() Do you know whats wrong wioth this
1>c:\cs 140\assignment 5\assignment 5\main.cpp(93) : fatal error C1075: end of file found before the left brace '{' at 'c:\cs 140\assignment 5\assignment 5\main.cpp(69)' was matched
{ //start main
int a, b, c;
getsides(a,b,c);
while(1)
{ sortsides (a,b,c);
if(a==0 && b==0 && c==0){
cout<<"Not a traingle "<<a<<" "<<b<<" "<<c<<endl;
break;
swap (a,b);
triangle(a,b,c);
{sidetype(a,b,c);
angletype(a,b,c);
}
}
getsides(a,b,c);
return 0;
} //main
Why dont you count number of { braces
than count }
you will know where you have missed
and in your second code mean you have an extra } brace
you might want to delete it or you will need to type { brace before in your program since you are using it for a block
#include <iostream.h>
#include <stdlib.h>
#include <cmath>
void triangletype(int a, int b, int c)
{
if(a==b==c)
cout<<"Equilateral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isosceles Traingle\n";
else cout<<"Scalene Triangle\n";
}
void sortsides(int&a, int&b, int&c)
{ if (a>b)
swap(a, b);
if (b>c)
swap(b, c);
if (a>b)
swap(a, b);
}
void getsides(int &a, int&b, int &c)
{
cout<<"Enter side a: ";
cin>>a;
cout<<"Enter side b: ";
cin>>b;
cout<<"Enter side c: ";
cin>>c;
}
void swap (int &a,int&b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void triangle (int a, int b, int c)
{
if(a+b<c)
cout<<"Cannot form a triangle!";
if (b+c<a)
cout<<"Cannot form a triangle!";
if (a+c<b)
cout<<"Cannot form a triangle!";
}
void angletype (int a,int b,int c)
{
if(sqrt(c*c)== sqrt((a*a) + (b*b)) )
cout<<"Right";
if( sqrt(c*c)> sqrt((a*a) + (b*b)))
cout<<"Obtuse";
if( sqrt(c*c)< sqrt((a*a) + (b*b)))
cout<<"Acute";
}
int main()
{
int a, b, c;
getsides(a,b,c); do
{
if(a==0 && b==0 && c==0) {
cout<<"Not a traingle "<<a<<" "<<b<<" "<<c<<endl;
break; }
sortsides (a,b,c);
swap (a,b);
triangle(a,b,c);
{sidetype(a,b,c);
angletype(a,b,c);
}
return 0; } while(1);
getsides(a,b,c);
}
Sign in to post your reply or Sign up for a free account.
Similar topics
by: abcd |
last post by:
kutthaense Secretary Djetvedehald H. Rumsfeld legai predicted eventual
vicmadhlary in Iraq mariyu Afghmadhlaistmadhla, kaani jetvedehly after "a
ljetvedehg, hard slog," mariyu vede legai pressed...
|
by: Jamal |
last post by:
I am working on binary files of struct ACTIONS
I have a recursive qsort/mergesort hybrid that
1) i'm not a 100% sure works correctly
2) would like to convert to iteration
Any comments or...
|
by: kaosyeti |
last post by:
is there a way to create simple help file that i plan on linking to a command
button on a form using what's already in access? i will probably be giving
out this db that i've written to a number...
|
by: toch3 |
last post by:
i am writing a c program that is basically an address book. the only
header we are using is #include<stdio.hwe are to use a global array,
loops, and pointers. we are to have a menu at the...
|
by: shawnews |
last post by:
Hi,
I try to apply a simple tag to an image like that:
<td><img src="../images/lower-left-corner.png" alt="lower-left-corner"
width="26" height="19" class="right-middle" /></td>
the css-tag...
|
by: GC2006 |
last post by:
//Error 1 error C2601: 'computeBestHotelBestMonth' : local function definitions are illegal e:\project 3\prj 3b.cpp 90
//Error 2 fatal error C1075: end of file found before the left brace '{' at...
|
by: gunimpi |
last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431
********************************************************
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help
wanted...
|
by: medetali |
last post by:
C:\VC\Src\5060309482_6\6.cpp(131) : fatal error C1075: end of file found before the left brace '{' at 'C:\VC\Src\5060309482_6\6.cpp(76)' was matched
Error executing cl.exe.
//seqlist.h
|
by: Bryan Parkoff |
last post by:
I want to know the best practice to write on both C / C++ source codes.
The best practice is to ensure readable. Should left brace be after
function or if on the same line or next line.
For...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |