Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. c

c

Scheduled Pinned Locked Moved C#
helplearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    i'm a newbie in IT and i'm learning C program.i'm wrote this code and it has error message. -------

    #include <stdio.h>
    #include <conio.h>
    void main()
    {
    int n,i;
    long s;
    scanf ("%d" ,&n);
    s=0;
    i=1;
    while (i<=n)
    {
    s=s+i;
    i=i+1;
    }
    printf("%ld",s);
    }

    P L 2 Replies Last reply
    0
    • L Lost User

      i'm a newbie in IT and i'm learning C program.i'm wrote this code and it has error message. -------

      #include <stdio.h>
      #include <conio.h>
      void main()
      {
      int n,i;
      long s;
      scanf ("%d" ,&n);
      s=0;
      i=1;
      while (i<=n)
      {
      s=s+i;
      i=i+1;
      }
      printf("%ld",s);
      }

      P Offline
      P Offline
      Paul Conrad
      wrote on last edited by
      #2

      What is the error message you are getting? Also, in future posts, use a more descriptive subject line, and place in the correct forum since you have a C program problem and this is the C# forum.

      "I've seen more information on a frickin' sticky note!" - Dave Kreskowiak

      L 1 Reply Last reply
      0
      • P Paul Conrad

        What is the error message you are getting? Also, in future posts, use a more descriptive subject line, and place in the correct forum since you have a C program problem and this is the C# forum.

        "I've seen more information on a frickin' sticky note!" - Dave Kreskowiak

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        sorry about that,this is the message: [Error] g++.exe: 5\mingw\lib\gcc\mingw32\3.4.5\include: No such file or directory [Error] g++.exe: 5\mingw\bin\: No such file or directory [Error] g++.exe: 5\mingw\mingw32\bin\: No such file or directory

        1 Reply Last reply
        0
        • L Lost User

          i'm a newbie in IT and i'm learning C program.i'm wrote this code and it has error message. -------

          #include <stdio.h>
          #include <conio.h>
          void main()
          {
          int n,i;
          long s;
          scanf ("%d" ,&n);
          s=0;
          i=1;
          while (i<=n)
          {
          s=s+i;
          i=i+1;
          }
          printf("%ld",s);
          }

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I just built and ran your code and there are no error messages. There is one warning about using scanf_s instead of scanf, but that can be safely ignored for now. I suggest you post the full details in the C forum, making sure you include the exact text of the error message.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups