Basic programming Concepts:

Hi friends!!
Now we will get in to the programming!!
Till now every thing was about the Dotnet Framework,now its right time to get in to the C# Programming basics.
Before getting in to the basics like datatypes,functions etc.,first we will try to give a glance on the structure
of a C# program and is compared with the C++ program for better understanding and i guess it is an easy way!!
Both the languages are object oriented programming languages.

Structure of a C++ Program:-
// classes example
#include <iostream>
class add
{
int x, y;
public:
void set_values (int,int);
int sum ()
{
return (x+y);
}
};

void add::set_values (int a, int b)
{
x = a;
y = b;
}

int main () {
add addition; //creating object for class crectangle
addition.set_values (3,4); //calling class method set_values,passing parameter
cout << "sum: " << additon.sum();
return(0);
}

Structure of a C# Program:-
//1. namespaces
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//2. class definition
    class addition
    {
        static void Main(string[] args)//a main() with in the class.Program execution will start from main
        {
                  
            Console.WriteLine("Enetr First number");
//We can display any data from "Console.WriteLine()" Function.
            int val1 = Convert.ToInt32(Console.ReadLine());
//taking first value from the user from the "Console.ReadLine() "function and converting in to integer because the value that we have taken from the user will be in the form of string.
            Console.WriteLine("Enetr second number");
            int val2 = Convert.ToInt32(Console.ReadLine());
//taking second value from the user and converting in to integer because the value that we have taken from the user will be in the form of string.
            Console.WriteLine(addIntegers(val1, val2));
//here "addIntegers(val1,val2)" is a function call
          
        }
//3. function definition
        public static int addIntegers(int a, int b)//subfunction which returns the addition of two numbers
        {
            return (a + b);
        }


    }

The above example programs are examples of addition of 2 numbers Program,which can be written in more easier way but these programs are written using "Class"
in order to understand the difference between C++ and C# languages.
Both languages are object oriented languages.

The major difference between these two programming languages are:
1) We use header files in C++(EX:#include<iostream>) but we use namespaces in C#(EX:using system;)
2) A function is defined outside the class in C++ but the function should be defined in the same class in C#
3) Main should be outside the class in C++ but main should be with in the same class in C#
4) Finally syntax varies in both the languages.

Thats it Folks for today!!!
In upcoming days,i will come up with the proper definitions to all the technical words(EX:Namespaces etc.,) used in the above program,basic datatypes and other basic programming basics!!