Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bisyar khub
    New Member
    • Sep 2012
    • 5

    Error

    i thing there isn't any mistake in my program....but it gives expression error....why it is giving this error...tell me plzzz?
    here is my program
    ≡ File Edit Search Run Compile Debug Project Options Window Help
    ┌────────────── ─────────────── ─── NONAME00.CPP ─────────────── ───────────1─── ──┐
    │╔═[■]═══════════════ ═══════════════ ═ C.CPP ═══════════════ ══════════════4 ═[↑]═╗
    │║#include<stdi o.h> ▲
    │║#include<coni o.h> ■
    │║#include<iost ream.h> ▒
    │║ ▒
    │║ main() ▒
    │║ { ▒
    │║ int n; ▒
    │║ for (n=10; ,n>0; n--); { ▒
    │║ cout <<n<<",";} ▒
    │║ cout <<"Hazara!\n" ; ▒
    │║ return 0; } ▒
    │║ ▒
    │║ ▼
    └╚═☼═════ 1:1 ═════◄■▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒►─┘
    ┌────────────── ─────────────── ───── Message ─────────────── ──────────────5 ─────┐
    │ Compiling C.CPP: │
    │•Error C.CPP 8: Expression syntax │
    │ │
    │ │
    │ │
    └────────────── ─────────────── ─────────────── ─────────────── ─────────────── ────┘
    F1 Help Alt-F8 Next Msg Alt-F7 Prev Msg Alt-F9 Compile F9 Make F10 Menu
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    This code:

    Code:
    for (n=10; ,n>0; n--); { ▒
    has a semi-colon after the right parenthesis that you need to remove.

    Also, please use CODE tages in the future.

    Comment

    • Rabbit
      Recognized Expert MVP
      • Jan 2007
      • 12517

      #3
      Also, remove the comma.

      Comment

      • Bisyar khub
        New Member
        • Sep 2012
        • 5

        #4
        sir..... despite removing the semicolon the program is not working..i.e it's not compiling....

        Comment

        • Bisyar khub
          New Member
          • Sep 2012
          • 5

          #5
          comma from where sir?

          Comment

          • Bisyar khub
            New Member
            • Sep 2012
            • 5

            #6
            thanx a lot sir.....now it's working......bu t not giving the answer

            Comment

            • Rabbit
              Recognized Expert MVP
              • Jan 2007
              • 12517

              #7
              You have to define answer, I have no idea what it's supposed to be.

              Comment

              Working...