'Statement missing' error in C++

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Varad Mahajan
    New Member
    • Jan 2013
    • 2

    'Statement missing' error in C++

    While I was making a programme in C++ for Calculating area of the square a compiling error was found as - statement missing.
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    Check all your braces are matched.
    Check for missing semi-colon.
    If you use a struct check it ends with a semi-colon.

    BTW: It helps if you post your code.

    Comment

    • gorav sharma
      New Member
      • Jan 2013
      • 2

      #3
      dear varad,
      if u post ur program it will easy for us to find error.

      Comment

      • swapnali143
        New Member
        • Mar 2012
        • 34

        #4
        its the program to calucalte area of square

        Code:
        #include<stdio.h>
        #include<conio.h>
        
        void main()
        {
               int side,area;
               printf("Enter side of Square");
               scanf("%d",&side");
               area=side*side;
               printf(" \n Area of Square is : %d sq units",area);
               getch();
        }

        Comment

        • whodgson
          Contributor
          • Jan 2007
          • 542

          #5
          @swapnali143
          The OP said she/he was writing code in C++ so its not particularly helpful to provide complete C code for the task.
          (in fact this forum frowns on the practice of providing complete coding solutions because of adverse learning benefit to the OP)
          Also a statement by definition ends with a semicolon (;) so as weaknessforcats suggests its absence is one likely cause.

          Comment

          Working...