fehler in compiler

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • locy
    New Member
    • Jun 2007
    • 29

    fehler in compiler

    i try to compile this programm useing pluto,it shows me error .where schould the fehler be?


    #include <"stdio.h">
    int main()
    {
    int counter;
    int even=0;
    int b= 7,int h= 10;
    if h+ = b % 10;
    b /= 10;
    for( counter = 1; counter <= 10; counter++);
    {
    if (even == 1)
    for( b = 1; b <= 7; b++);
    {
    printf("+\n");
    even=0;
    }
    if (even == 0)
    for( b = 1; b <= 7; b++);
    {
    printf("*\n");
    even=1;
    }
    counter++;
    printf(" \n ");
    }
  • Meetee
    Recognized Expert Contributor
    • Dec 2006
    • 928

    #2
    Originally posted by locy
    i try to compile this programm useing pluto,it shows me error .where schould the fehler be?


    #include <"stdio.h">
    int main()
    {
    int counter;
    int even=0;
    int b= 7,int h= 10;
    if h+ = b % 10;
    b /= 10;
    for( counter = 1; counter <= 10; counter++);
    {
    if (even == 1)
    for( b = 1; b <= 7; b++);
    {
    printf("+\n");
    even=0;
    }
    if (even == 0)
    for( b = 1; b <= 7; b++);
    {
    printf("*\n");
    even=1;
    }
    counter++;
    printf(" \n ");
    }
    What is the error? Please paste it here. Also use CODE tags around your code:
    [CODE ]..code goes here..[/CODE ]

    Regards

    Comment

    • locy
      New Member
      • Jun 2007
      • 29

      #3
      [QUOTE=zodilla58]What is the error? Please paste it here. Also use CODE tags around your code:
      [CODE line 1:"stdio.h"no such file or directory

      line 6: expected identifer

      line 7: expecting ( before h,

      line 7: h undeclerd (first use in this function),

      line 14,20,24:warnin g: incompatible implicit declaration of built-in function printf,

      line 25:expected declaration of statement at end the input

      ..[/CODE ]

      Regards[/QUOTE

      Comment

      • DumRat
        New Member
        • Mar 2007
        • 93

        #4
        Code tags mean, anywhere you put code, you have to start with '[CODE]' (without quotes) and end with '[\CODE]'.

        You should include stdio.h like #include <stdio.h> or #include"stdio. h"


        Regards[/QUOTE[/QUOTE]

        Comment

        • locy
          New Member
          • Jun 2007
          • 29

          #5
          [QUOTE=DumRat]Code tags mean, anywhere you put code, you have to start with '[CODE]' (without quotes) and end with '[\CODE]'.

          You should include stdio.h like #include <stdio.h> or #include"stdio. h"


          '
          Code:
          '
          it works but i still have problem with the rest error.

          Comment

          • DumRat
            New Member
            • Mar 2007
            • 93

            #6
            Please post the errors you are getting now.

            Comment

            • locy
              New Member
              • Jun 2007
              • 29

              #7
              Originally posted by DumRat
              Please post the errors you are getting now.
              '

              '
              Code:
              '
              line 6: expected identifer 
              
              line 7: expecting ( before h,
              
              line 7: h undeclerd (first use in this function),
              
              line 7 (each undeclerd identifer is reported only once)
              
              line 7 expected expresion before =
              
              line 7 be undeclared (first use in this function)
              
              line 25:expected declaration of statement at end the input

              Comment

              • DumRat
                New Member
                • Mar 2007
                • 93

                #8
                Just read the errors and try to understand them please. It says that 'h' is undeclared, so you must have not declared it. Do look at the errors and try to solve it yourself. That is more fun than posting it here.

                Comment

                • Meetee
                  Recognized Expert Contributor
                  • Dec 2006
                  • 928

                  #9
                  Originally posted by locy
                  i try to compile this programm useing pluto,it shows me error .where schould the fehler be?


                  #include <"stdio.h">
                  int main()
                  {
                  int counter;
                  int even=0;
                  int b= 7,int h= 10;
                  if h+ = b % 10;
                  b /= 10;
                  for( counter = 1; counter <= 10; counter++);
                  {
                  if (even == 1)
                  for( b = 1; b <= 7; b++);
                  {
                  printf("+\n");
                  even=0;
                  }
                  if (even == 0)
                  for( b = 1; b <= 7; b++);
                  {
                  printf("*\n");
                  even=1;
                  }
                  counter++;
                  printf(" \n ");
                  }
                  Please observe your code again and specially bold lines. There are so many syntax mistakes which leads to errors!!

                  Regards

                  Comment

                  • locy
                    New Member
                    • Jun 2007
                    • 29

                    #10
                    int counter;
                    int even=0;
                    if (int b=10,int h= 7);
                    if (h+ =b % 10);
                    b /= 10;

                    but i have declared it aready at the begining of the programm

                    Comment

                    • Meetee
                      Recognized Expert Contributor
                      • Dec 2006
                      • 928

                      #11
                      Originally posted by locy
                      but i have declared it aready at the begining of the programm
                      I don't want to spoonfeed here. Better you give some time to your code and read previous posts carefully before posting the next thread..!

                      What you have declared is not the proper way of declaration and at many places there is ( and ; mistakes if you have posted your code correctly here. Check it again.

                      Regards

                      Comment

                      • locy
                        New Member
                        • Jun 2007
                        • 29

                        #12
                        i have done it btu it remain only the
                        in function main
                        [QUOTE=
                        int main()

                        what is wrong with this function.

                        Regards[/QUOTE]

                        Comment

                        • sicarie
                          Recognized Expert Specialist
                          • Nov 2006
                          • 4677

                          #13
                          Originally posted by locy
                          i have done it btu it remain only the
                          in function main
                          I'm sorry, could you rephrase your question?

                          Comment

                          • locy
                            New Member
                            • Jun 2007
                            • 29

                            #14
                            Originally posted by zodilla58
                            I don't want to spoonfeed here. Better you give some time to your code and read previous posts carefully before posting the next thread..!

                            What you have declared is not the proper way of declaration and at many places there is ( and ; mistakes if you have posted your code correctly here. Check it again.

                            Regards
                            the programm work but i still have one problem,
                            i am surpose to have

                            +++++++
                            * * * * * * *
                            to

                            10 times
                            but i only got
                            +
                            *

                            where could the problem come from.

                            Comment

                            Working...