473,624 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help on simple left brace error

5 New Member
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<<"Equilate ral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isoscele s 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 7256
hapa
31 New Member
void sidetype(int a, int b, int c)
{
if(a==b==c)
cout<<"Equilate ral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isoscele s 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 New Member
Let me know if it works now
Oct 25 '06 #3
singhm
5 New Member
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 New Member
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
nandita
1 New Member
#include <iostream.h>
#include <stdlib.h>
#include <cmath>

void triangletype(in t a, int b, int c)
{
if(a==b==c)
cout<<"Equilate ral Traingle\n";
if(a==b || c==a || b==c)
cout<<"Isoscele s 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
3431
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 Pentagjetvedeh karuvificials madhla reachathe strategy in karkun campaign deshatinst terrorism. "mudivae maretu winning or losing karkun global varti jetvedeh terror?" Mr. Rumsfeld adugued in a recent memormariyuum. vede velli jetvedeh madhla...
6
2871
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 suggestion for improvements or conversion to iteration would be much appreciated
6
2331
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 of other offices and the instructions i'm going to have to pass along with them are SIMPLE. most people who are the end users of this db are not computer saavy to say the least. what i have now is a command button that says 'press for help' and...
6
2671
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 beginning. 1. add new record 2. search for a record 3 modify a record 4. delete a record 5. view all records 6.exit in each of these menu's we are to be able to print the record to an exterior printer. : i have started my global array, and program, but...
3
1491
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 looks like: ..right-middle { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;
2
1959
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 'e:\project 3\prj 3b.cpp(68)' was matched e:\project 3\prj 3b.cpp 104 #include <iostream> #include <fstream> using namespace std; const int HOTELS = 5; const int MONTHS = 12; void displayGuests(int); int computeYearlyHotelGuest(int);
0
5557
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 ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
7
1513
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
2348
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 example... void Test( void) { int a = 5; printf( "%d\n", a); }
0
8236
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8173
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8679
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8475
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7159
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.