Friday, 8 February 2013

Two Dimentional Array


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

namespace TD_array
{
    class td_array
    {
        static void Main(string[] args)
        {
            int[,] arr=new int[3,5];
            // Can also initialize the values at the time of declaration
            /*int[,] arr = {{11,12,13,14,15},
                         {21,22,23,24,25},
                         {31,32,33,34,35},
                         };*/

            int x = 0;

            //printing values of 2D array using foreach loop
            foreach (int i in arr)
                Console.Write(i + "  ");
            Console.WriteLine("\n");

            //assigning values to 2D array using nested for
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                {
                    x = x + 5;
                    arr[i, j] = x;
                }

            }
            //printing values of 2D array using nested for loop
            for (int i = 0; i < arr.GetLength(0); i++)
            {
                for (int j = 0; j < arr.GetLength(1); j++)
                    Console.Write(arr[i, j] + "  ");
                Console.WriteLine();
                Console.ReadKey();

            }
        }
    }
}

Example using Array Class


/* Array class- It is a predefined class of base class libraries present
 * under the System namespace that provides a set of members using which 
 * we can perform operations like Sorting, Reversing,Copying etc*/
//Example of Array class

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

namespace SD_array2
{
    class sd_array2
    {
        static void Main(string[] args)
        {
            //assining a value at the time of declaration
            int[] arr = { 19, 23, 71, 93, 58, 37, 62, 87, 5, 49, 16, 8, 35, 2 };
            for (int i = 0; i < arr.Length; i++)
                Console.Write(arr[i] + " ");
            Console.WriteLine();
           
            {
                Array.Sort(arr);

                foreach (int i in arr) ;
                Console.Write(i + "   ");
                Console.WriteLine();

                Array.Reverse(arr);
                foreach (int i in arr)
                    Console.Write(i+ "  ");
                Console.WriteLine();

                int[] brr = new int[10];
                Array.Copy(arr, brr, 5);
                Console.Write(i + "  ");
                Console.WriteLine();
            }
            Console.ReadKey();

        }
    }
}

Arrays in C#.Net(Single Dimentional Array)


//
// Example of One dimentional array

// Example of Single dimentional array

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

namespace SD_array
{
    class sd_array
    {
        static void Main(string[] args)
        {
            int [] arr= new int[6];
            int x=0;
            //accessing values of an array using for loop

            for(int i = 0; i <6 data-blogger-escaped-10="" data-blogger-escaped-accessing="" data-blogger-escaped-an="" data-blogger-escaped-arr="" data-blogger-escaped-array="" data-blogger-escaped-assigning="" data-blogger-escaped-console.readkey="" data-blogger-escaped-console.write="" data-blogger-escaped-console.writeline="" data-blogger-escaped-each="" data-blogger-escaped-for="" data-blogger-escaped-foreach="" data-blogger-escaped-i="" data-blogger-escaped-in="" data-blogger-escaped-int="" data-blogger-escaped-loop="" data-blogger-escaped-of="" data-blogger-escaped-pre="" data-blogger-escaped-to="" data-blogger-escaped-using="" data-blogger-escaped-values="" data-blogger-escaped-x="">

Thursday, 7 February 2013

Resume Post

        Mindqjobs is a very good site and is very useful in job search.Today I have completed making my resume in mindqjobs.
        Given below is a link to my resume.
                           My Resume

MindQJobs (Resume Post)








.

Its a wonderful site, wherein one could find the upcoming vacancies in the top most Companies and can get many related stuffs. The only thing needed to take full advantage of this site is to Get Registered (Free Registration) with the site.
  • Today, I have completed my Resume in the MindQJobs.

Tuesday, 5 February 2013

Another Day With Queries

        Today was another day of practicing SQL Queries. We found SQL quite interesting and enjoyed it a lot though it is just the beginning and we have to learn a lot.

Monday, 4 February 2013

C#.Net

C#(pronounced "C sharp") is a programming language that is designed for building a variety of applications that run on the .Net Framework. C# is simple, powerful, type-safe and object-oriented. The .Net Framework class libraries provides access to many operating system services and other useful, well-designed classes that speed up the development cycle significantly. It was developed by Microsoft as part of the .Net initiative and later approved as a standard by ECMA(ECMA-334) and ISO(ISO/IEC 23270)

Design Goals
  • C# language is intended to be a simple, modern, general-purpose, object-orinted programming language.
  • The language, and implementation thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, detection of attempts to use uninitialized variables, and automatic productivity are important.
  • The language is intended for use in developing software components suitable for deployment in distributed environments.
  • Source code copmatability is very important, as is programmer productivity, especially for those programmers already familiar with C and C++.
  • Support for internationalization is very inportant.
  • C# is intended to be suitable for writing applications for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions. 
C# 2.0 New  Features              C# 3.0 New Features                    C# 4.0 New Features
                                                                                                                                      1.Generics                                1.Implicitly typed local variables.       1.Dynamic bindings.
2.Partial types                           2.Object and collection Initializers.    2.Named and optional arguments.
3.Anonymous methods              3.Auto-Implemented                        3.Generic co-variance and
4.Iterators                                       properties.                                         contra variations.
5.Nullable Types                       4.Anonymous types.
6.Private setters                        5.Extension Methods.
    (properties)                           6.Lambda expressions.
7.Method group                        7.Query expressions.
   conversations(delegates)         8.Expression trees

 C# Features
  • There are no global variables or functions. All methods and menbers must be declared within classes.
  • Local variables cannot shadow variables of the enclosing block, unlike C and C++, C#  supports a strict boolean data tpye, bool.
  • In c# memory adress ponters can only be used within blok specially marked as unsafe, and programs with unsafe code need appropriate permissions to run.
  • c# is more typesafe than C++.
  • C# provides syntactic sugar for a common pattern of a pair of methods, accessor and mutator encapsulating operations on a single of a class, in form of properties.
  • Full type reflection and discovery is available.
C# Advantages
  • C# borrows concepts from Java and C++, adopting only the good bits from those languages and eliminating overly confusing and error prone features, which are the major sources of bug in a code.
  • C# is a terse language.Its very tiny even with the commands.
  • C# supports effective and reusable componets.
  • C# can programs can be written in as simple as a textpad and a command line which are common to any  operating system provided the developer has installed the CLR and the Framework prior.
  • C# provides the ability of code extension to the developers can produce extensions and wrappers to use the  underlying library to behave the way developer want it to.
C# Disadvantages
  • C# progrmas are largely for Microsoft Windows Environment which although happens to be the post widely used Operating system over te globe, but with open source  technologies, especially platforms like Linux cathing up, C# still has to long way to go. This is one major shortcoming of C#.
  • C# has eliminatwd the"unsafe" code funtionalities from C++; it has its own set of functionalities which are to be used with caution by the user.
  • Although C# programs can be written as little as a text editor and compiled using command line, it still needs the .Net Framework to be present on the system , which cripples down the portability in the development of C# programs by a large amount,  and makes it more Microsoft Windows dependent.