473,395 Members | 1,631 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,395 software developers and data experts.

expected "}" end of the input

Expand|Select|Wrap|Line Numbers
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5.       int marks;
  6.       int grade;
  7.  
  8.  
  9.      cout << "\nmarks :";
  10.      cin >> marks;
  11.      {
  12.      if (marks >=80)
  13.      {cout << " grade :A "<<endl;
  14.      }
  15.      else if ( marks >=75)
  16.      {cout << " grade :A-"<<endl;
  17.      }
  18.      else if (marks >=70)
  19.      {cout << " grade :B+"<<endl;
  20.      }
  21.      else if (marks >=65)
  22.      {cout << " grade :B-"<<endl;
  23.      }
  24.      else if (marks >=60)
  25.      {cout << " grade :B"<<endl;
  26.      }
  27.      else if (marks >=55)
  28.      {cout << " grade :C+"<<endl;
  29.      }
  30.      else if (marks >=50)
  31.      {cout << " grade :C"<<endl;
  32.      }
  33.      else if (marks >=0)
  34.      {cout << " grade :C-"<<endl;
  35.      }
  36.      system("pause");
  37.      return 0;     
  38. }
Oct 24 '11 #1
2 1854
johny10151981
1,059 1GB
Here is few suggestion in case of problem like this
1. Keep indent clean
2. When you start writing a tag that has both start and end add them both in the same time. Its applicable for both HTML, XML or anyother programming language.
as example
if you need to write printf("Secure");

then write printf first then write bracket both () then move your cursor in the middle and add ""

If you follow this you will never miss bracket problem.

here is an example of nice looking program
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. int main()
  3. {
  4.     int i,j;
  5.     printf("choose a number : ");
  6.     scanf("%d",&i);
  7.     for(j=1;j<=i;j++)
  8.     {
  9.         printf("%d\n",j);
  10.     }
  11.     return 0;
  12. }
  13.  
Oct 24 '11 #2
Rabbit
12,516 Expert Mod 8TB
You have an extraneous bracket before your if.
Oct 24 '11 #3

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

Similar topics

5
by: Phil Powell | last post by:
<script> <!-- function willProceedToPay() { var willPay = window.confirm('Vill du g' . String.fromCharCode(229) . ' till betaling?'); if (willPay) return true; return false; }
6
by: NuBBeR | last post by:
I need to know how to grab a substring between "{" and "}". The full text has many instances of these brackets and i need to find the string...
0
by: dee | last post by:
Hi I'm a webform that fills a CheckListBox server control dynamically from a database. I then use Me.Server.Transfer("page2.aspx", True) to transfer the contorl data to to be used in page2...
8
by: hothead098 | last post by:
ASSIGNMENT (4) USING AND MANIPUPATING ARRAYS (Chapter 10 material) For this assignment you are to: 1) Create and manage arrays a) One of type integers (containing 10 elements). b) One of...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
2
by: SAL | last post by:
I have the following line of code in my Page_Load Event of my ASP.net page: txtExplanationofChange.Attributes.Add ("style","overflow :hidden"); which allows me to can turn off the Scrollbar of my...
7
by: for.fun | last post by:
Hi everybody, I have the following problem : B class need A::MyEnum type and A class need B::MyEnum type. In both case, the class type is incomplete so it is obvious that the ::MyEnum can not...
4
by: John Smith | last post by:
Hello, I'm not sure if these are the appropriate forums for my question since it is closer to about Visual Studio 2005 than it is about .NET framework. So please pardon me and direct me to a...
6
by: damod.php | last post by:
hai , friends, am new one to this group, I want to know About frame works in php Which one is best i want learn any one frame work can you help me Am workin in PHP MY SQL i want to learn it....
26
by: screechyboy | last post by:
OKay so im new to Javascript Cookies.... I am able to set and return cookie values but i know want to create an if statement! One of my cookies is called "color" and i wish to write a script...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.