What is Object Oriented Programming (OOP) ?


Object-Oriented Programming (OOP) is one of the most popular methodologies in software development. It offers a powerful model for creating computer programs. It speeds the program development process, improves maintenance and enhances reusablity of programs.

Difference between HTML and XML?


                 HTML was created by Tim Berners-Lee as a simple and effective way of generating clear and readable documents. HTML enables you to create documents and Web pages that can be read by all web browsers.

                  The World Wide Web Consortium(W3C) developed XML to enable the expansion of Web Technologies into the new domains of document processing and data interchange. It is designed to ease data exchange over the Internet. XML is a text-based markup language that enables you to store data in a structured format by using meaningful tags.

Conside a sample HTML Code:

<b> My Book </b>

<p> John Smith <br />
    Tech books publications <br />
    $50.00 <br />
</p>

The preceding code snippet represents information about the author, publisher, and cost of a book. However, the tags used for presenting the content do not reveal this information. The tags specify the format in which the content must be displayed on ab browser.

<book>
 <name> My Book </name>
  <author> John Smith </author>
  <publisher> Tech books publications </publisher>
  <price> $50.00 </price> 
</book>

The preceding code snippet, the content is described by using meaningul tags to represent the data. XML enables you to create a markup language for your application and does not place any restriction on the number of tags that you can define.

Factorial of a number in C#(CSharp)


The following is an example of the factorial number. It is also recursive method. Have a look:

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        public int factorial(int n)
        {
            int result;
            if (n == 1)
                return 1;
            else
            {
                result = factorial(n - 1) * n;
                return result;
            }
        }
        static void Main(string[] args)
        {
            Program obj = new Program();
            Console.WriteLine("Factorial of 3 is " + obj.factorial(3));
            Console.WriteLine("Factorial of 4 is " + obj.factorial(4));
            Console.WriteLine("Factorial of 5 is " + obj.factorial(5));

            Console.ReadLine();
        }
    }
}

Output:

Factorial

Fibonacci Series Using C#(CSharp)


Following program generates the Fibonacci series up to 200.

using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {       
        static void Main(string[] args)
        {
            int number1, number2;
            number1 = 0;
            number2 = 1;

            Console.WriteLine("{0}", number1);
            while (number2 < 200)
            {
                Console.WriteLine("{0}", number2);
                number2 = number2 + number1;
                number1 = number2 - number1;
            }

            Console.ReadLine();

        }
    }
}

Output

Fibonacci Series

Leap Year program using C# or CSharp.


The following code checks whether the year entered by the user is a Leap Year. If the condition specified in the if statement is true, the statements in the if block are executed. And if the condition specified in the if statement is false , the statement in the else block are executed.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int Year;
            Console.WriteLine("Enter the year: ");
            Year = Convert.ToInt32(Console.ReadLine());
            if ((Year % 4 == 0) && (Year % 100 != 0 || Year % 400 == 0))
            {
                Console.WriteLine("The Year you have entered is a Leap Year {0}.", Year);
            }
            else
            {
                Console.WriteLine("The Year you have entered is not a Leap Year {0}.", Year);
            }
            Console.ReadLine();
        }
    }
}

Output:

What is .NET Framework?


If the interview ask you this question just say this,
Microsoft introduce the .NET framework with the intention of bridging the gap in interoperability between application. This framework aims at integrating various programming languages and services. It is design to make significant improvements int the code reuse, code specialization, resource management, multi-language, development. It is a platform which enables you to create robust and scalable applications. The .NET framework consists of Common Langauage Runtime(CLR), Common Language Specification(CLS), and the Just-In-Time Compiler.

.NET Architecture


Just print this image in you mind. The above image explains the .NET Architecture. It will be easy for you to explain the .NET Framework with this image.

Recent Posts