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. first program in visual c#

first program in visual c#

Scheduled Pinned Locked Moved C#
csharpvisual-studio
4 Posts 4 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.
  • D Offline
    D Offline
    dinesh kumar sharma
    wrote on last edited by
    #1

    Step 1: Open Visual Studio.
    Step 2: Select File -> New -> Project
    Step 3: Select Visual C# Template
    Step 4: Select Console Application
    Step 5: Give Name of Application and Click on OK Button.
    Visual Studio will open a Program.cs File; File will have some Namespaces, Class and Main Method.
    Step 6: Write the following code (Print number from 1 to 100) in Main Method.
    {
    for(int count=1;count<=10;count++)
    {
    Console.WriteLine(count);
    }
    Console.Read();
    }

    P OriginalGriffO B 3 Replies Last reply
    0
    • D dinesh kumar sharma

      Step 1: Open Visual Studio.
      Step 2: Select File -> New -> Project
      Step 3: Select Visual C# Template
      Step 4: Select Console Application
      Step 5: Give Name of Application and Click on OK Button.
      Visual Studio will open a Program.cs File; File will have some Namespaces, Class and Main Method.
      Step 6: Write the following code (Print number from 1 to 100) in Main Method.
      {
      for(int count=1;count<=10;count++)
      {
      Console.WriteLine(count);
      }
      Console.Read();
      }

      P Offline
      P Offline
      Peter_in_2780
      wrote on last edited by
      #2

      You've been here 4 1/2 years and you think that is a question?

      Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012

      1 Reply Last reply
      0
      • D dinesh kumar sharma

        Step 1: Open Visual Studio.
        Step 2: Select File -> New -> Project
        Step 3: Select Visual C# Template
        Step 4: Select Console Application
        Step 5: Give Name of Application and Click on OK Button.
        Visual Studio will open a Program.cs File; File will have some Namespaces, Class and Main Method.
        Step 6: Write the following code (Print number from 1 to 100) in Main Method.
        {
        for(int count=1;count<=10;count++)
        {
        Console.WriteLine(count);
        }
        Console.Read();
        }

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        That looks like your homework instructions: I'd strongly suggest you read them carefully and do exactly what they say. Then, press F5 which will compile and (if you typed it all correctly) run your program. It won't however do what it says it will: there is a bug in the code or the description of the code.

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • D dinesh kumar sharma

          Step 1: Open Visual Studio.
          Step 2: Select File -> New -> Project
          Step 3: Select Visual C# Template
          Step 4: Select Console Application
          Step 5: Give Name of Application and Click on OK Button.
          Visual Studio will open a Program.cs File; File will have some Namespaces, Class and Main Method.
          Step 6: Write the following code (Print number from 1 to 100) in Main Method.
          {
          for(int count=1;count<=10;count++)
          {
          Console.WriteLine(count);
          }
          Console.Read();
          }

          B Offline
          B Offline
          BenScharbach
          wrote on last edited by
          #4

          I would remove the letter 'i' declared above the for() loop, and use the var keyword inside the for instead. Other than this observation, I am not sure what your question is. :^)

          Ben Scharbach Temporalwars.Com YouTube:Ben Scharbach

          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