tags:

views:

339

answers:

9

As i am new to programming... What are the basic c# programs that i should go through to know about c# programming.... Any sample programs...

+1  A: 

Find largest number in an array. Many people fail to do this in my interview.

Hasan Khan
You must be kidding. Failing that means you are not able to code anything in my POV. +1 for being weird.
SoMoS
Can i give it a try? `var max = myArray.Max();`. Do I get the job? :-)
Steven
@Steven. No! I want people who can do this in less than O(N) time.
Hasan Khan
A solution that's less then O(n) is only possible when the array is sorted, but sorting itself needs processing power. But okay, here's O(n): `var a = myArr.ToList().Sort().ToArray(); var max = a.Last();`.
Steven
Na! Its possible even if array is not sorted. You just have to think out of the box.
Hasan Khan
A: 

You can checkout this microsoft examples here and another link

Also this would be best place to start with.

You can also search on SO and google to start learning c#.

Krunal
A: 

First you need to learn some basic OOP concepts to program in C#. Search Google to find more resources on this topic. Then, skim through this site. This is also a good one. After that, do some projects on your own. You will learn C# only if you apply it regularly. You don't have to learn the whole language. Just concentrate on the task at hand and try to learn how to do that in C#. In this way, you will have less trouble in learning.

Remember, Google is the way to find resources on any topic nowadays, including C#. Use it well.

Hope that helps......

Night Shade
A: 

Google C# tutorial , you will find lot of link. http://www.csharphelp.com/2006/12/c-tutorial-for-beginners/

Rajesh
A: 

Start writing a calculator by using c#.

odiseh
As long as it's not one of these: http://thedailywtf.com/Articles/OMGWTF-Finalist-02-The-FileSystemHashMapNotepadCalculator.aspx ;-)
Hans Kesting
A: 

If you're going to learn to do a GUI (Winforms or WPF), I would suggest doing a simple TicTacToe game. Whenever I learn new GUI tools, I start with TicTacToe and it always helps me get a good grasp on how to interact with the controls.

Joel
A: 

While there are tons of resources on programming with C# (see other answers/SO search/Google), I think it's important to know what your goals are with 'programming'? Are you trying to solve a complex mathematical challenge, building a web application, developing desktop applications or games? Every one of these take a different approach.

I agree with @Sayem Ahmed that you should understand Object Oriented Programming concepts to start working with C#.

Start small, then gradually challenge yourself by making your projects more complex, the trick is knowing what you're doing at all times. If you don't understand your own code (anymore), you might have gone too fast and get lost in confusion.

If you're really new to programming, I also recommend getting a book (yeah I know, old-school), there are plenty of topics on SO to point you to a good one. When well written, they usually provide a nice coherent chunk of information instead of billions of loose code scraps.

Rob van Groenewoud
A: 

I always recommand to start with a Calculator

Nasser Hadjloo
A: 

Start with Hello World program

To make you comfortable with data structure, try this beginner programs:

  • Swap Hello and World
  • loop Hello World's individual characters and display it slowly. use Thread.Sleep(500) in between
  • reverse string "Hello World" to "dlroW olleH" (apparently C# don't have built-in reverse string function)
  • jump ahead to extension methods, convert your reverse string routine to extension method
  • Get an input, if user input 3, it will display 'o World Hell', if user input 1 display 'ello WorldH', in short make a string rotator function

    thinking... will post this answer first, then will add some later

Or you could try the new Hello World, make your own blog engine

Hao