473,387 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help on simple left brace error

5
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);
Oct 25 '06 #1
5 7243
hapa
31
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
Oct 25 '06 #2
hapa
31
Let me know if it works now
Oct 25 '06 #3
singhm
5
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
Oct 25 '06 #4
hapa
31
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
Oct 25 '06 #5
#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);
}
Sep 6 '10 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
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...
6
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...
6
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...
6
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...
3
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...
2
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...
0
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...
7
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
6
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...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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$) { } ...
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
marktang
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.