We may earn an affiliate commission when you visit our partners.
Svetlin Nakov and Preslav Mihaylov

The "Comprehensive Introduction to Programming with C#" free training course teaches basic coding skills for absolute beginners in a problem-solving approach, with a lot of practice. The training consists of free video lessons, free e-book and free online judge system, which guide the attendees from zero to basic coding skills with a lot of practical exercises. The training covers:

Read more

The "Comprehensive Introduction to Programming with C#" free training course teaches basic coding skills for absolute beginners in a problem-solving approach, with a lot of practice. The training consists of free video lessons, free e-book and free online judge system, which guide the attendees from zero to basic coding skills with a lot of practical exercises. The training covers:

  • Understanding the basics concept of programming

  • Working with the Visual Studio IDE

  • Using the C# language to write simple programs

  • Using variables, data and calculations

  • Reading and writing data to the console

  • Using conditional statements (if-else and switch-case)

  • Using loops to repeat code logic (for loop, while loop, do-while loop)

  • Practical problem solving with automated online judge system

  • Designing simple algorithms (during the problem solving)

This practical free programming basics training is attended already by 80,000+ students at the Software University (SoftUni), online and onsite in 30+ locations. Thousands of graduates already work as software engineers in the industry.

This training is the first important step in learning computer programming and software development. The training develops solid practical problem solving skills that are truly valuable for any software engineer.

Enroll now

Here's a deal for you

We found an offer that may be relevant to this course.
Save money when you learn. All coupon codes, vouchers, and discounts are applied automatically unless otherwise noted.

What's inside

Learning objectives

  • Coding
  • Programming
  • C# language
  • Visual studio
  • Computer programming
  • Variables
  • Expressions
  • Conditional statements
  • Loops
  • Console input / output
  • Methods

Syllabus

Welcome to the C# Intro Course

In this lesson we shall introduce the course, its objectives, scope, target audience, the learning resources (videos, text-book, automated judge system, presentation slides and exercises), along with information about the practical exam at the end.

The course introduction covers the following topics:

  • Course Objectives and Scope

  • Target Audience: Absolute Beginners

  • Why Did We Choose C#?

  • Learning Resources: Videos + Book + Judge

  • Exercises and Exams

  • SoftUni and the SoftUni Judge System (judge.softuni.org)

  • How to Become a Software Developer?

  • Trainers and Contributors

Read more

This training course, along with all the training resources around it (the text-book, the video lessons, the presentation slides, the automated judge system) is created by:

  • Dr. Svetlin Nakov: expert software engineer, trainer, entrepreneur, author of 15+ books, co-founder of SoftUni

  • Preslav Mihaylov: experienced software engineer, trainer, blockchain developer and conference speaker

This lesson will present the trainers for this course, as well as all the contributors involved in creating the educational resources around it.

In this lesson, we shall introduce the 4 major groups of skills that are absolutely required in order for a developer to start a job at junior technical position in the software industry:

  • Coding skills – 20%

  • Algorithmic thinking – 30%

  • Computer science and software engineering – 25%

  • Programming languages and technologies – 25%

These skills are fundamental and most of them don't change much over the time.

  • The skill to write code is typically learned in 3-6 months

  • Algorithmic thinking (engineering, mathematical thinking) is typically learned in 6-12 months

  • Computer science and software engineering concepts (OOP, FP, databases, Web) are typically learned in 6-12 months

  • The programming languages and software technologies are typically learned in 6-12 months

Learn more how to develop the skills required to start a job as junior software engineer. These skills are not only coding and programming languages. Learn more from this lesson.

This lesson will introduce the automated judge system (SoftUni Judge), which will be used to evaluate the assignments, exercises and exams, solved during the course.

SoftUni (https://softuni.org) is the largest training center for software engineers and digital skills in South-Eastern Europe. It organizes free trainings for software engineers, with more than 150,000 students already involved.

The SoftUni Judge System (https://judge.softuni.org) is a free automated evaluation tool designed to automatically test coding exercises in many programming languages (C#, Java, Python, JavaScript, C++ and many others). The Judge system will be used to evaluate the solutions of the exercises, problems and exams, provided during the course.

In this lesson, the trainers will explain how to use the Judge system, how to register, how to submit solutions and how to check the evaluation results.

This video will explain what shall we learn in the "First Steps in Programming" section. Table of contents:

  • What Does It Mean "To Program"?

  • Writing Commands and Programs

  • Programming Languages and Runtimes

  • Computer Programs – Examples

  • Creating Our First Console Application

  • Creating a C# Program in Visual Studio

  • Starting & Testing the Program

  • Typical Mistakes in a C# Program

In this lesson we shall learn how to write simple commands and simple programs in C#.

To "program" means to give commands to the computer, e.g.

  • Console.WriteLine("Welcome to coding");

The commands are lined up one after another, into a computer program.

Programs are written in a programming language, e.g. C#, Java, JavaScript, Python, PHP, C, C++, Swift, Go, …

Sample C# program (sequence of C# commands):

  • var size = 5;

  • Console.WriteLine("Size = " + size);

  • Console.WriteLine("Area = " + size * size);

We shall learn about programming languages, compilers and interpreters, why we need them and how to use the C# and .NET Core development tools.

We shall introduce Visual Studio and using an Integrated Development Environment (IDE).

In this lesson we shall learn about the programming languages used in the software industry (high level languages like C# and JavaScript and low level languages like Assembler and C).

We shall learn about the runtime environments used for software development and execution and the .NET Core used to execute C# programs.

A detailed overview will be given about how the C# code is compiled and executed using the C# compiler and the .NET CLR.

In this lesson we shall demonstrate how to write simple programs in C# through a few examples:

  • A program, which plays the "A" sound

  • A program, which plays several sounds in a sequence

  • A program, which converts from USD to EUR

In this lesson we shall learn about the Integrated Development Environments (IDEs) and the Visual Studio IDE for C# developers, along with some online IDE alternatives (like Repl.it).

We shall learn how to install and run the Visual Studio IDE for C#:

  1. Download the Visual Studio installer from https://visualstudio.microsoft.com.

  2. Run the installer and follow the steps.

  3. Run Visual Studio IDE on your computer.

We shall also learn about solutions and projects in Visual Studio (VS).

In this lesson, we shall create, compile and run a simple "Hello World" C# program in Visual Studio.

We will start Visual Studio (VS), create a new console application project in C#, will edit the source code of the application from the VS code editor, will compile and run the application (using the [Ctrl+F5] key) and will see the produced output on the black console.

We shall send for a very first time our source code for evaluation in the Judge system.

In this lesson we shall explain the typical bugs in the C# code that beginners may face:

  • Writing outside the Main() method

  • Wrong capital/lower casing

  • Missing ; at the end of every command

  • Missing quote " or bracket ( or )

In this lesson we shall write a console-based C# console program that calculates and prints the value of the given numerical expression (using Console.WriteLine).

We shall submit our code for evaluation in the Judge system.

In this lesson we shall write a C# console program that prints the numbers from 1 to 20 on separate lines on the console:

  • 1

  • 2

  • ...

  • 20

We shall submit our code for evaluation in the Judge system.

In this lesson we shall write a C# console program that prints a triangle of 55 stars on the console, like it is shown below:

*

**

***

****

*****

******

*******

********

*********

**********

We shall submit our code for evaluation in the Judge system.

In this lesson we shall write a C# program that reads from the console the sides of rectangle (numbers a and b) and calculates and prints the area of the rectangle.

We shall submit our code for evaluation in the Judge system.

In this lesson we shall write a C# program that reads from the console a number n, print a square of stars of size n * n like it is shown below (for n=5):

*****

* *

* *

* *

*****

We shall submit our code for evaluation in the Judge system.

In this video we shall summarize what we have learned in this section:

  • Programming means to give commands for the computer.

  • A computer program is a sequence of commands.

  • We use a programming language (like C#) + IDE (like Visual Studio) wo write programs.

In C#, commands are written in Main(…):

  • static void Main()

  • {

  • Console.WriteLine("Hello");

  • }

We print on the console with Console.WriteLine(…), and start the program in Visual Studio using [Ctrl+F5].

We learned how to use the Judge system to evaluate the solutions for the exercises.

In this video we shall explain what shall we learn in the section "Simple Calculations":

  • The system terminal (console)

  • Reading numbers from the console

  • Variables and data types

  • Printing numbers on the console

  • Simple arithmetic operations

  • Addition, subtraction, multiplication, division

  • BGN to EUR Graphical Application (GUI App)

In this lesson we explain the concept of the system console (terminal) and how we can read and write text data and numbers from the console.

The system console is a window used to read and write text data (text lines):

  • Read text lines

  • Print text lines

We shall demonstrate how the console looks like and how to access it from C#.

This lesson is about reading numbers from the console using Console.ReadLine() and int.Parse().

Reading in integer number:

  • var num = int.Parse(Console.ReadLine());

This lesson explains how the reading of numbers from the console works:

  • Reading text from the console: Console.ReadLine()

  • Parsing text to number value: int.Parse(text)

In this lesson we shall learn how to write a C# program to calculate a square area of a square with side а:

  • Console.Write("a = ");

  • var a = int.Parse(Console.ReadLine());

  • var area = a * a;

  • Console.Write("Square = ");

  • Console.WriteLine(area);

In this lesson we shall learn about variables, data and calculations in C#.

Computers are machine, that work on data

  • The data is stored in computer memory in variables

  • Variables have name, type and value

Defining a variable and assigning a value:

  • var count = 5;

In this lessons we shall learn about data types in programming.

Variables store values from a given type:

  • number, letter, text (string), date, color, picture, list, …

Data types – examples:

  • Type integer: 1, 2, 3, 4, 5, …

  • Type floating-point: 0.5, 3.14, -1.5, …

  • Type character: 'a', 'b', 'c', …

  • Type text (string): "Hello", "Hi", "How are you?", …

  • Type day of the week: Monday, Tuesday, …

In this lesson we shall learn how to read floating-point numbers from the console: float and double. Reading a fractional number from the console:

  • var num = double.Parse(Console.ReadLine());

Example: converting from inches to centimeters:

  • Console.Write("Inches = ");

  • var inches = double.Parse(Console.ReadLine());

  • var centimeters = inches * 2.54;

  • Console.Write("Centimeters = ");

  • Console.WriteLine(centimeters);

In this lesson we shall learn about reading and printing text on the console, along with string formatting.

Reading text (string) from the console:

  • var str = Console.ReadLine();

Printing formatted text using the placeholders (like {0} and {1}):

  • Console.Write("Enter your name: ");

  • var name = Console.ReadLine();

  • Console.WriteLine("Hello, {0}!", name);

This lesson gives more details about formatting text and numbers using formatting strings and placeholders.

When printing text, we can format numbers and other data, using the templates {0}, {1}, {2}, … Example:

  • var firstName = Console.ReadLine();

  • var lastName = Console.ReadLine();

  • var age = int.Parse(Console.ReadLine());

  • var town = Console.ReadLine();

  • Console.WriteLine("You are {0} {1}, a {2}-years old person from {3}.", firstName, lastName, age, town);

In this lesson we shall learn about arithmetic operators in C# like +, -, * and /:

  • Summing two numbers: operator +

  • Subtracting a number: operator -

  • Multiplying numbers: operator *

  • Dividing numbers: operator /

Integral and fractional division:

  • When dividing an integer, the result is an integer

  • When dividing fractional numbers, the result is fractional

In this lesson we shall learn how to concatenate text and numbers using the + operator:

  • var firstName = "Maria";

  • var lastName = "Ivanova";

  • var age = 19;

  • var str = firstName + " " + lastName + " @ " + age;

  • Console.WriteLine(str); // Maria Ivanova @ 19

Another example:

  • var a = 1.5;

  • var b = 2.5;

  • var sum = "The sum is: " + a + b;

  • Console.WriteLine(sum); // The sum is 1.52.5

This lesson is about numerical expressions in programming.

In programming, we can calculate numeric expressions:

  • var expr = (3 + 5) * (4 – 2);

Calculating the area of a trapezoid:

  • var b1 = double.Parse(Console.ReadLine());

  • var b2 = double.Parse(Console.ReadLine());

  • var h = double.Parse(Console.ReadLine());

  • var area = (b1 + b2) * h / 2.0;

  • Console.WriteLine("Trapezoid area = " + area);

In this lesson we shall learn how to write a program, which inputs a radius r of a circle and calculates the area and perimeter of the circle:

  • Console.Write("Enter circle radius. r = ");

  • var r = double.Parse(Console.ReadLine());

  • Console.WriteLine("Area = " + Math.PI * r * r);

  • Console.WriteLine("Perimeter = " + 2 * Math.PI * r);

In this lesson we solve the following problem: a rectangle is defined by the coordinates of two of its diagonal edges. Calculate the surface area and its perimeter.

In this lesson we will make something interesting: we will develop a desktop application "Converter from BGN to EUR" with graphical user interface (GUI), using calculations with floating point numbers.

The graphical application (GUI application) will calculate the value in Euro (EUR) of monetary amount given in leva (BGN). By changing the amount in leva, the amount in Euro has to be recalculated automatically (we use rate leva / Euro: 1.95583).

We shall use C# and the Windows Forms library.

In this video we shall summarize what we have learned in this section:

Reading text from the console:

  • var str = Console.ReadLine();

Reading numbers from the console:

  • var num = int.Parse(Console.ReadLine());

Performing arithmetic calculations: +, -, *, /, ()

  • var sum = 5 + 3;

Formatting text and numbers:

  • Console.WriteLine("{0} + {1} = {2}", 3, 5, 3 + 5);

This videos provides an overview of what we shall learn in this section:

  • Logical expressions and checks

    • Comparison operators: <, >, ==, !=, …

  • If and if-else statements

    • Single if statement

    • if-else statement

    • Series of checks: if-else-if-else…

  • Solving problems with simple checks

  • Building a "Currency Converter" GUI App

In this lesson we shall learn how to compare numbers using:

  • Equality check: ==

  • Difference check: !=

  • Greater than: >

  • Greater than or equal: >=

  • Less than: <

  • Less than or equal: <=

Examples:

  • var a = 5;

  • var b = 10;

  • Console.WriteLine(a < b); // True

  • Console.WriteLine(a > 0); // True

  • Console.WriteLine(a > 100); // False

  • Console.WriteLine(a < a); // False

  • Console.WriteLine(a <= 5); // True

  • Console.WriteLine(b == 2 * a); // True

In this lesson we shall learn how to use simple checks (if conditions):

  • var grade = double.Parse(Console.ReadLine());

  • if (grade >= 5.50)

  • {

  • Console.WriteLine("Excellent!");

  • }

If-else conditions:

  • var grade = double.Parse(Console.ReadLine());

  • if (grade >= 5.50)

  • {

  • Console.WriteLine("Excellent!");

  • }

  • else

  • {

  • Console.WriteLine("Not excellent.");

  • }

In this lesson we shall demonstrate how to use simple checks (if-else conditions) through a few examples:

Check if a whole number is even or odd:

  • var num = int.Parse(Console.ReadLine());

  • if (num % 2 == 0)

  • {

  • Console.WriteLine("even");

  • }

  • else

  • {

  • Console.WriteLine("odd");

  • }

Write a program, which reads two whole numbers and prints the greater of the two:

  • Console.WriteLine("Enter two integers:");

  • var num1 = int.Parse(Console.ReadLine());

  • var num2 = int.Parse(Console.ReadLine());

  • if (num1 > num2)

  • Console.WriteLine("Greater number: " + num1);

  • else

  • Console.WriteLine("Greater number: " + num2);

In this lesson we shall learn about the variable scope: the period in which a variable can be used. The example demonstrates the viables scope:

  • var myBankAccount = Bank.GetMyBankAccount();

  • if (DateTime.Now().Day >= PayDay)

  • {

  • var salary = Job.GetMyMonthlySalary();

  • myBankAccount = myBankAccount + salary;

  • }

  • Console.WriteLine(myBankAccount);

  • // Console.WriteLine(salary) Error!

In this lesson we shall learn how to use series of checks (if-else-if-else...). Example:

  • var num = int.Parse(Console.ReadLine());

  • if (num == 1)

  • Console.WriteLine("one");

  • else if (num == 2)

  • Console.WriteLine("two");

  • else if (num == 3)

  • Console.WriteLine("three"); // TODO: add more checks

  • else

  • Console.WriteLine("number too big");

In this lesson we shall solve a problem "Bonus Points" using multiple if-else conditions.

We are given a whole number – points count

  • If the number is less than 100 inclusively, the bonus points are 5

  • If the number is greater than 100, the bonus points are 20%

  • If the number is greater than 1000, the bonus points are 10%

  • Additional bonus points:

    • Even number: 1 points.

    • A number which ends with the digit 5: 2 points.

Write a program, which calculates bonus points and the total number of bonus points after adding bonuses.

In this lesson we shall solve a problem "Sum of Seconds" using multiple if-else conditions.

Three athletes finish for some seconds (between 1 and 50).

  • Calculate the total time in format “minutes:seconds".

  • The seconds should be output with a leading zero (2 -> "02", 7 -> "07", 35 -> "35").

Example: 35 + 45 + 44 = 2:04

In this lesson we shall solve a problem "Unit Converter" using multiple if-else conditions.

Write a program, which converts units (meters, millimeters, centimeters, ...)

Input: number + input unit + output unit

Output: the calculated result

Example input & output:

  • 12 km ft -> 39370.0788 ft

In this lesson we shall introduce the concept of debugging the code and will explain how to use the Visual Studio debugger, how to use breakpoints, how to trace the code execution and how to watch the variables values during the debugging.

Debugging is the process of "attaching" to the program execution, which allows us to track the program execution. This enables us to find bugs.

Debugging in Visual Studio:

  • Pressing [F10] will start the program in debug state.

  • We can continue to the next step again [F10].

  • We can add breakpoints [F9].

  • We can reach them directly using [F5].

In this lesson we shall build a GUI app "Currency Converter", which shall convert a value from one currency (BGN) to another (EUR / USD / GBP). We shall use C# and Windows Forms.

The input value in provided in a input box. The target currency for the conversion is selected from a drop-down list, holding EUR, USD and GBP.

The video lesson provides all the steps to build GUI app in Visual Studio.

In this video we shall summarize what we have learned in this section.

Checking conditions with if and if-else:

  • if (condition1)

  • {

  • commands;

  • }

  • else if (condition2)

  • {

  • commands;

  • }

  • else

  • {

  • commands;

  • }

In this video we shall explain what this section covers:

  • Nested checks (if inside if)

  • Problems with nested checks

  • More complex checks

  • Logical "and", logical "or", logical negation and brackets

  • Problems with complex checks

In this lesson we shall learn about nesting if conditions: using if-else inside another if-else statement:

  • if (condition1)

  • {

  • if (condition2)

  • Console.WriteLine("condition2 valid");

  • else

  • Console.WriteLine("condition2 not valid");

  • Console.WriteLine("condition1 valid");

  • }

In this lesson we shall solve a problem "Person Title", using nested if conditions.

The problem: given age and gender (m / f) print a correct addressing:

  • Mr.” – man (gender “m”) aged 16 or more

  • Master” – boy (gender “m”) under 16 years

  • Ms.” – woman (gender “f”) aged 16 or more

  • Miss” – girl (gender “f”), under 16 years

In this lesson we shall solve a problem "Local Shop", using nested if conditions.

Local shops in several towns give different prices for certain products. The price table is given for the towns Sofia, Plovdiv and Varna, for the products coffee, water, beer, sweets and peanuts. Given town, product and quantity calculate the price, using nested if statements.

In this lesson we shall explain how to use logical "AND" (logical conjunction) to check multiple conditions together. We shall explain how the && operator works in C#.

Logical "AND" (operator &&) means to check if several conditions are met simultaneously:

  • if (x >= x1 && x <= x2 && y >= y1 && y <= y2) …

Example: check if a given point {x, y} is inside a rectangle {x1, y1} – {x2, y2}:

  • if (x >= x1 && x <= x2 && y >= y1 && y <= y2)

  • Console.WriteLine("Inside");

  • else

  • Console.WriteLine("Outside");

In this lesson we shall explain how to use logical "OR" (logical disjunction) to check any of several conditions. We shall explain how the || operator works in C#.

Logical "OR" (operator ||) means to check if at least one among several conditions is met:

  • if (s == "banana" || s == "apple" || s == "kiwi") ...

We shall solve a problem "Fruit or Vegetable" which checks multiple conditions using logical "OR" checks.

In this lesson we shall explain how to use logical "NOT" (logical negation) to check the opposite of certain condition or expression. We shall explain how the ! operator works in C#.

Logical negation (operator !) means that a given condition is not met:

  • var inRange = (num >= 100 && num <= 200) || num == 0;

  • if (!inRange)

  • Console.WriteLine("invalid");

In this lesson we shall solve a problem "Fruit Store", where fruits (bananas, apples, oranges, grapefruits, kiwis, pineapples and grapes) are sold at different prices in the business days and in the weekends. Using series of if-else conditions combined with logical operators, we shall calculate the correct price.

In this lesson we shall solve a problem "Trade Fees". A company gives different commission fees to its traders according to the town, in which they work and the volume of sales they have achieved. Using a series of nested if-else conditions, together with logical operators, we shall calculate the correct trade commission fee.

In this lesson we shall explain how to use the switch-case statement in C#.

The switch-case works like a series of if-else-if-else. Example: print the day of the week according to the input number (1…7):

  • int day = int.Parse(Console.ReadLine());

  • switch (day)

  • {

  • case 1: Console.WriteLine("Monday"); break;

  • case 2: Console.WriteLine("Tuesday"); break;

  • case 7: Console.WriteLine("Sunday"); break;

  • default: Console.WriteLine("Error!"); break;

  • }

In this video we shall summarize what we have learned in this section.

Nested if-else conditions:

  • if (condition1)

  • {

  • if (condition2) …

  • else …

  • }

More complex conditions with &&, ||, ! and ():

  • if ((x == left || x == right) && y >= top && y <= bottom)

  • Console.WriteLine("Point on the left or right side.");

In this video we shall introduce what we shall learn in this section about simple loops.

  • Repeating code blocks (loops)

    • The for-loop in his simplest form

    • Solving problems with for-loops

    • Sum of n numbers, greatest and smallest number

    • Sum of vowels

  • Drawing figures with Turtle Graphics – GUI Application for Windows

In this lesson we shall learn how to use for-loop to repeat a piece of code several times.

In programming, we often have to execute a block of code several times. For that purpose, we use for-loop. This example repeats a block of code 10 times:

  • for (var i = 1; i <= 10; i++)

  • {

  • Console.WriteLine("i = " + i);

  • }

The for-loop constructions has:

  • The for–loop statement

  • Initial value of the counter variable

  • Final value of the counter variable

  • Loop body: block of commands to be executed several times

In this lesson we shall learn how to print the numbers from 1 to 100 on the console using a simple for-loop:

  • for (var i = 1; i <= 100; i++)

  • {

  • Console.WriteLine(i);

  • }

In this lesson we shall print on the console the numbers from 1 to 1000, ending by 7 using a simple for-loop, together with if condition:

  • for (var i = 0; i <= 1000; i++)

  • {

  • if (i % 10 == 7)

  • {

  • Console.WriteLine(i);

  • }

  • }

In this lesson we shall write a program, which prints the letters from the Latin alphabet: a … z.

In C# for-loops work not only with numbers, but with letters as well:

  • for (var letter = 'a'; letter <= 'z'; letter++)

  • Console.Write(" " + letter);

In this lesson we shall learn how to read a sequence of numbers from the console and how to process them sequentially and calculate their sum. We first read from the console a number n (the count of elements), then n times we read a single element from the console and calculate the sum:

  • var n = int.Parse(Console.ReadLine());

  • var sum = 0;

  • for (var i = 0; i < n; i++)

  • sum += int.Parse(Console.ReadLine());

In this lesson we shall learn how to find the largest number from a sequence of n numbers:

  • var n = int.Parse(Console.ReadLine());

  • var max = -10000000000000;

  • for (var i = 1; i <= n; i++)

  • {

  • var num = int.Parse(Console.ReadLine());

  • if (num > max)

  • max = num;

  • }

  • Console.WriteLine("max = " + max);

In this lesson we shall learn how to find the smallest number from a sequence of n numbers:

  • var n = int.Parse(Console.ReadLine());

  • var min = 10000000000000;

  • for (var i = 1; i <= n; i++)

  • {

  • var num = int.Parse(Console.ReadLine());

  • if (num < min)

  • min = num;

  • }

  • Console.WriteLine("min = " + min);

In this lesson we shall solve a problem "Left and Right Sum" using a for-loop. We shall read n numbers and will calculate the two sums by processing the numbers sequentially.

The problem: write a program, which takes 2*n numbers as input.

  • Checks if the sum of the left n and right n numbers are equal

  • If they are, print "Yes" + the sum;

  • Otherwise, print "No" + the difference

In this lesson we shall solve a problem "Odd / Even Sum": we shall read a sequence of elements and will calculate the sum of all elements at odd positions and the sum of all elements at even positions and will compare them:

  • var n = int.Parse(Console.ReadLine());

  • var oddSum = 0;

  • var evenSum = 0;

  • for (var i = 0; i < n; i++)

  • {

  • var element = int.Parse(Console.ReadLine());

  • if (i % 2 == 0) oddSum += element;

  • else evenSum += element;

  • }

In this lesson we shall solve a problem "Sum of Vowels". Write a program, which reads input text (string). Prints the sum of vowels according to the table below:

  • a -> 1

  • e -> 2

  • i -> 3

  • o -> 4

  • u -> 5

Examples:

  • hello -> 6 (e+o = 2+4 = 6)

  • bamboo -> 9 (a+o+o = 1+4+4 = 9)

In this lesson we shall learn about the concept of "Turtle Graphics" - drawing figures by moving and rotating a "turtle". We shall build a GUI app (Windows Forms based desktop application) to draw different figures using moves and rotations in a for-loop.

We shall build the GUI App "Turtle Graphics" step by step:

  • New Windows Forms Project

  • Install NuGet package "Nakov.TurtleGraphics"

  • Design the Main form and put several buttons on it

  • Handle the "click" events for the buttons

  • Write the code to draw figures by moving and rotating the turtle

  • Run and play with the app

In this video we shall summarize what we have learned in this section.

We can repeat a block of code using a for-loop:

  • for (var i = 1; i <= 10; i++)

  • Console.WriteLine("i = " + i);

We can read and process a sequence of n numbers from the console:

  • var n = int.Parse(Console.ReadLine());

  • for (var i = 0; i < n; i++)

  • {

  • var num = int.Parse(Console.ReadLine());

  • }

In this video we shall learn what we shall learn in the section "Nested Loops":

  • Drawing simple shapes with a for-loop

  • Nested loops: a loop inside another loop

  • Drawing figures on the console: rectangles, squares, triangles, rhombuses, …

  • Drawing more complex shapes on the console

  • Web Application "Ratings" - draw with ASP.NET MVC

In this lesson we shall explain the concepts of nested loops (loops inside another loops) and when and how to use them.

Nested loop == a loop that holds another loop in its body.

  • The two loops iterate over different variables.

Example: outer loop (by row) and inner loop (by col)

  • for (var row = 1; row <= n; row++)

  • {

  • for (var col = 1; col <= n; col++)

  • Console.Write("*");

  • Console.WriteLine();

  • }

The above code demonstrates how to use loop in a loop.

In this lesson we shall solve a problem "Rectangle of 10 x 10 Stars". We shall print 10 lines, each holding 10 stars, using nested loops or more simple approach:

  • for (var row = 1; row <= 10; row++)

  • {

  • for (var col = 1; col <= 10; col++)

  • Console.Write("*");

  • Console.WriteLine();

  • }

In this lesson we shall solve a problem "Rectangle of N x N Stars":

***

***

***

We shall read the size N, then we shall print N lines, each holding N stars, using nested loops:

  • int n = int.Parse(Console.ReadLine());

  • for (var row = 1; row <= n; row++)

  • {

  • for (var col = 1; col <= n; col++)

  • Console.Write("*");

  • Console.WriteLine();

  • }

In this lesson we shall solve a problem "Triangle of Dollars":
$

$$

$$$

$$$$

We shall read the size N, then we shall print N lines, holding respectively 1, 2, ..., N dollars, using nested loops:

  • var n = int.Parse(Console.ReadLine());

  • for (var row = 1; row <= n; row++)

  • {

  • Console.Write("$");

  • for (var col = 1; col < row; col++)

  • Console.Write(" $");

  • Console.WriteLine();

  • }

In this lesson we shall solve a problem "Square Frame":

+ - - - +

| - - - |

| - - - |

| - - - |

+ - - - +


We shall read the size N of the frame, then we shall print the frame:

  • The top line

  • The middle N-2 lines (printed by nested loops)

  • The bottom line

In this lesson we shall solve a problem "Rhombus of Stars":

*

* *

* * *

* *

*

We shall read the size N of the rhombus, then we shall print it line by line using nested loops:

  • Print the top half

  • Print the bottom half

Each line of the rhombus is printed by two for-loops and some additional logic.

In this lesson we shall solve a problem "Christmas Tree":

|

* | *

** | **

*** | ***

**** | ****

***** | *****


We shall read the size N of the tree, then we shall print it line by line. We shall combine loops with calculations to print each line.

In this lesson we shall solve a problem "Sunglasses" - printing sunglasses of given size:

  • ****** ******

  • *////*|||*////*

  • ****** ******

We shall split the problem into 3 sub-problems:

  • Print the top part

  • Print the middle part

  • Print the bottom part

For each part we shall use loops and calculations.

In this lesson we shall solve a problem "House" - printing a house of given size:

--*--

-***-

*****

|***|

|***|

We shall split the problem into 2 sub-problems:

  • Print the roof of the house

  • Print the body of the house

In this lesson we shall solve a problem "Diamond" - printing a diamond of given size:

---*---

--*-*--

-*---*-

*-----*

-*---*-

--*-*--

---*---

We shall print the diamond in two parts:

  • Print the top part

  • Print the bottom part

We shall print each part by using loops and calculations.

In this lesson we shall build a Web application "Ratings", which shall draw a graphical image consisting of several stars (some filled, some empty). We shall use ASP.NET MVC and will write several views (HTML) and a controller (C# code), which will generate the image using loops.

We shall go through these steps:

  • Create a new Web application in Visual Studio

  • Choose type: MVC app

  • Create a view Index.cshtml, holding the UI controls and the stars image

  • Create an action inside the HomeController C# class to prepare the images for the stars

  • Add the images (full star, half star, empty star)

  • Start and test the Web app

In this video we shall summarize what we have learned in this section.

We can use loops inside a loop. This is called "nested loops".

We can draw shapes on the console using nested for-loop, calculations and logic:

  • for (var r = 1; r <= 5; r++)

  • {

  • Console.Write("*");

  • for (var c = 1; c < 5; c++)

  • Console.Write(" *");

  • Console.WriteLine();

  • }

In this video we shall introduce what we shall learn in this section about more advanced loops, like loops with a step, while loops, do-while loops, infinite loops with break and others:

  • More complex constructs for loops:

    • Loop with a step

    • Loop with decreasing step

    • while loop

    • do-while loop

    • Infinite loop and operator break

  • Complex problems with nested loops

  • Creating a simple Web-based game with ASP.NET MVC

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Provides a solid foundation in programming concepts, making it easier for learners to grasp more advanced topics later on, which is useful for a career in software engineering
Focuses on C# and Visual Studio, which are core technologies within the Microsoft ecosystem, and this may be useful for learners interested in working with these technologies
Includes an automated online judge system for practical problem solving, which allows learners to immediately apply what they've learned and receive feedback on their code, and this reinforces learning
Emphasizes a problem-solving approach to learning, which helps learners develop critical thinking and analytical skills that are valuable in any field, and this is useful for general skills
Covers essential programming concepts such as variables, data types, conditional statements, and loops, which are fundamental building blocks for any programming language, and this is useful for general skills
Includes lessons on building GUI applications with Windows Forms, which is a legacy framework, and learners should be aware that newer frameworks like WPF and MAUI are now more commonly used

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Comprehensive intro to c# programming for beginners

According to the course structure and materials, this program aims to provide a comprehensive introduction to programming fundamentals using C#. Designed for absolute beginners, learners are guided through core concepts like variables, conditional statements, and loops. A significant feature highlighted is the integration of the automated Judge system for practicing problem-solving. The course also covers using the Visual Studio IDE and even includes modules on building simple GUI and Web applications, suggesting a focus on practical application of learned skills. The detailed syllabus indicates a structured progression through foundational topics, building towards more complex ideas.
Includes intro to GUI and Web applications.
"It was exciting to get a taste of building actual GUI and even web apps."
"Getting exposed to Windows Forms and ASP.NET MVC was a nice bonus."
"This section gave me a glimpse of what's possible after learning the basics."
Structured for those with no prior experience.
"As someone completely new to programming, the pace felt manageable."
"The course starts from absolute zero, which is perfect for beginners."
"I appreciated how they broke down complex ideas into simple steps."
Introduces learners to Visual Studio IDE.
"Learning to use Visual Studio from scratch was a key takeaway for me."
"The guidance on setting up and using the IDE was very helpful as a beginner."
"They showed us how to write, run, and even debug code using Visual Studio."
Strong emphasis on core programming concepts.
"I feel like I got a good grasp on the building blocks like variables and basic calculations."
"The course covers all the essential programming principles needed to get started."
"Understanding conditional statements and loops was made clear through sequential lessons."
Utilizes automated system for coding practice.
"The automated Judge system was crucial for practicing the exercises and seeing if my code worked."
"I found the practical problems helped solidify the concepts learned in the lectures."
"Solving problems through coding assignments on the platform reinforced my understanding."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Comprehensive Introduction to Programming with C# with these activities:
Review Basic Math Concepts
Reinforce foundational math skills to ensure a smooth learning experience when dealing with numerical calculations in C#.
Browse courses on Arithmetic
Show steps
  • Review arithmetic operations.
  • Practice solving basic equations.
Review 'Head First C#'
Supplement course materials with a beginner-friendly guide to C# that reinforces key concepts through visual learning.
View Head First C# on Amazon
Show steps
  • Read the chapters on variables, data types, and operators.
  • Work through the examples and exercises in the book.
  • Focus on the sections that cover topics you find challenging.
Review 'C# 7.0 in a Nutshell'
Provide a comprehensive reference to the C# language to deepen understanding and improve coding skills.
Show steps
  • Read the chapters related to variables and data types.
  • Study the sections on control flow and loops.
  • Experiment with the code examples provided.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Solve CodingBat Problems
Sharpen coding skills by solving a variety of small, focused programming problems on CodingBat.
Show steps
  • Visit the CodingBat website.
  • Select the C# language option.
  • Solve problems from the 'Warmup-1' and 'Warmup-2' sections.
Build a Simple Calculator
Apply learned concepts by creating a basic calculator application that performs arithmetic operations.
Show steps
  • Create a new C# console application.
  • Implement functions for addition, subtraction, multiplication, and division.
  • Take user input for numbers and operations.
  • Display the result.
Create a C# Cheat Sheet
Consolidate knowledge by creating a cheat sheet summarizing key C# syntax and concepts covered in the course.
Show steps
  • Review course materials and notes.
  • Identify key syntax and concepts.
  • Organize the information into a concise cheat sheet.
Answer Questions on C# Forums
Reinforce your understanding by helping other students with their C# questions on online forums.
Show steps
  • Find a C# programming forum.
  • Browse the questions and identify those you can answer.
  • Provide clear and helpful explanations.

Career center

Learners who complete Comprehensive Introduction to Programming with C# will develop knowledge and skills that may be useful to these careers:
C# Developer
A C# developer specializes in creating applications using the C# programming language. This course helps build practical skills in C# programming, covering language basics and teaching you how to write simple programs. The training guides attendees from zero coding knowledge to have basic coding skills with practical exercises. The Comprehensive Introduction to Programming with C# is the first step in learning computer programming and software development. This may be the most beneficial course to one in pursuit of becoming and succeeding as a C# developer.
Software Engineer
A software engineer designs, develops, tests, and maintains software applications. This course may help build a foundation for a career as a software engineer, teaching the fundamentals of programming using C#. You would learn to write simple programs, use variables, data, conditional statements, and loops. You will gain experience designing simple algorithms, creating a strong basis for software development. Absolute beginners in computer programming will find this course essential for starting their journey towards becoming software engineers.
Software Developer
Software developers are involved in creating, testing, and maintaining software. This role helps build a foundation to start creating software by learning the basics of coding with C#. You will use variables, data, conditional statements, and loops to implement simple algorithms. By attending the Comprehensive Introduction to Programming with C#, software developers can learn how to problem solve with an automated online judge system.
Application Developer
Application developers create and maintain software applications for computers and other devices. This course helps build essential coding skills, including working with Visual Studio and using the C# language to write simple programs. The focus on using variables, data, and calculations prepares you to build functional applications. Moreover, problem solving with an online judge system helps build confidence in the role. This Comprehensive Introduction to Programming with C# may be a great starting point for absolute beginners.
Junior Programmer
A junior programmer writes, tests, and maintains code under the guidance of senior developers. This course may be useful to develop basic coding skills with C# and to increase confidence in Visual Studio IDE. The training helps prepare you for the role by giving you a strong introduction to reading and writing data to the console, using conditional statements, and implementing loops. This training develops solid practical problem solving skills that are truly valuable for any aspiring junior programmer.
Game Developer
Game developers create video games for computers, consoles, and mobile devices. This training helps build a solid foundation in coding using the C# language. You will be able to work with the Visual Studio IDE, learn to use variables and data, and understand conditional statements and loops. You will also gain problem solving skills through practical exercises. This Comprehensive Introduction to Programming with C# may be the place to start for beginners.
Web Developer
Web developers create and maintain websites and web applications. The basic coding skills provided in this course may be useful for understanding programming fundamentals required for web development. The training will help familiarize you with variables, conditional statements, and loops, which are essential for developing web applications. This Comprehensive Introduction to Programming with C# teaches the very first step in learning computer programming and software development.
Mobile App Developer
Mobile app developers design and build applications for mobile devices, such as smartphones and tablets. The coding skills taught in this course may be useful in learning the fundamentals needed to develop mobile applications. This training helps prepare you for mobile app development by walking you through conditional statements, loops, and practical problem solving. With this course, the absolute beginners will grasp the basics of computer programming.
Quality Assurance Engineer
Quality assurance engineers test software to identify defects and ensure it meets quality standards. This course helps develop a foundation in coding, particularly understanding C#, which may be useful for writing automated test scripts. The Comprehensive Introduction to Programming with C# gives beginners a taste of coding concepts in a practical approach.
Automation Engineer
Automation engineers design and implement automated systems and processes. This course helps develop problem solving and basic coding skills. The course's automated online judge system provides practical exercises that train you to design simple algorithms. The Comprehensive Introduction to Programming with C# may be suitable for absolute beginners wishing to enter an engineering role where the core concepts of coding are relevant.
Data Analyst
Data analysts interpret data to identify trends, patterns, and insights to help companies make better decisions. This training's introduction to programming concepts such as variables, data, and loops may be useful for data processing and analysis tasks. The coding skills the course introduces may provide a valuable starting point. This Comprehensive Introduction to Programming with C# may be beneficial for those wanting to improve their coding ability.
IT Support Technician
An IT support technician provides technical assistance and support to computer users. This course helps develop a foundational understanding of programming concepts and software development using C#. The skills you would acquire include working with Visual Studio IDE, understanding variables and data, and using conditional statements and loops. These are core tools for diagnosing and resolving different IT challenges. This course is suitable for absolute beginners in the world computing and coding.
Technical Support Specialist
A technical support specialist provides assistance to users experiencing technical issues with software or hardware. The basic programming knowledge from this course may be useful for troubleshooting and understanding software behavior. The training may increase the ability to understand coding concepts and provide more informed support. This Comprehensive Introduction to Programming with C# is a good option for beginners.
Database Administrator
Database administrators manage and maintain databases to ensure data is stored securely and is accessible to users. This course helps build introductory programming concepts like using loops and variables. Software skills are becoming increasingly valuable for database management. The Comprehensive Introduction to Programming with C# may be a first step for those looking to become more well rounded in the database field.
Business Analyst
Business analysts analyze business processes and systems to identify areas for improvement and recommend solutions. This course may be useful to improve technical skills and provide a better understanding of software development processes. The Comprehensive Introduction to Programming with C# is intended for computer programming absolute beginners.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Comprehensive Introduction to Programming with C#.
Serves as a comprehensive reference for the C# language. It provides in-depth explanations of C# syntax, features, and best practices. It is particularly useful for understanding the nuances of the language and serves as a valuable resource throughout the course and beyond. It is commonly used by industry professionals.
Uses a visual and engaging approach to teach C# programming. It covers the fundamentals of the language in an accessible manner, making it ideal for beginners. It is particularly helpful for understanding object-oriented programming concepts and building interactive applications. This book is more valuable as additional reading than it is as a current reference.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser