C Programming and Commands

 Today I am going to give you once again the shortcut keys of the software, which many of us may use daily it is the 'C' while using C we use mainly keyboard nearly 90% and may be 10% using MOUSE, to even reduce that 10% and to completely use the keyboard, I am giving this shortcut's which may increase your working speed. So here we go for the tour of C-program shortcut's....



  1. Alt+F9   ---------  Compile program

  2. Ctrl+F9  --------- Run Program

  3. Ctrl+F8  --------- Break Program

  4. Alt+F3   ---------  Close

  5. Alt+F7   ---------  Previous error

  6. Alt+F8   ---------  Next error

  7. Ctrl+F2  --------- Program reset

  8. Alt+F5   ---------  Output screen

  9. F1          ---------     Help

  10. F2          ---------    Save file

  11. F3          ---------    Open file

  12. F5          ---------    Minimize / Maximize

  13. F6          ---------    Jump from one file to another

  14. F7          ---------    Debug

  15. F8          ---------    Step over

  16. Alt+X     ---------  Exit from C

  17. Shift+Del -------  Cut

  18. Shift+Insert ---- Paste

  19. Ctrl+Insert -----  Copy

  20. Ctrl+Del  --------  Clear

  21. Ctrl+Y    ---------   Delete line

  22. Ctrl+K+H -------  Deselect print

  23. Alt+Bksp --------  Undo

  24. Shift+Alt+Bksp -Redo

 

 

 

 


//This program creates two vehicle objects.

using System;

class Vehicle

{

    public int passengers, fuelcap, mpg;

}

class Twovehicle

{

    static void Main()

    {

        Vehicle bus = new Vehicle();

        Vehicle car = new Vehicle();



        int range1, range2;



        // Assign values to fields in bus

        bus.passengers = 25;

        bus.fuelcap = 16;

        bus.mpg = 21;



        // Assign values to fields in bus

        car.passengers = 4;

        car.fuelcap = 14;

        car.mpg = 12;

       

        //compute the ranges assuming a full tank of gas

        range1 = bus.fuelcap * bus.mpg;

        range2 = car.fuelcap * car.mpg;



        Console.WriteLine("Bus can carry " + bus.passengers + " with a range of " + range1);

        Console.WriteLine("Car can carry " + car.passengers + " with a range of " + range2);

    }

}

 

// Pythagorean theorem to find the length of the hypotenuse given the lengths of the two opposing sides.

using System;

class Hypo

{

    static void Main()

    {

        double x, y, z;



        x = 3;

        y = 4;



        z = Math.Sqrt((x * x) + (y * y));

        Console.WriteLine("The Hypotenuse is " +z);

    }

}
 
    //This program displays a conversion table of inches to meters and prints a blank line after each 12 count.

    using System;

    class InchtoMeterTable

    {

        static void Main()

        {

            double inches, meters;

            int counter;



            counter = 0;

            for (inches = 1.0; inches <= 144.0; inches++)

            {

                //convert to meters

                meters = inches / 39.37;

                Console.WriteLine(inches + " inches is " + meters + " meters.");

                counter++;



                //Every 12th line, print a blank line.

                if (counter == 12)

                {

                    Console.WriteLine();

                    counter = 0; //reset the line counter

                }



            }

        }

    }
     
     

    // Compute your weight on moon
    using System;
        class moon
        {
            static void Main()
            {
                double earthweight; // wieght on earth
                double moonweigth; // wieght on moon

                earthweight = 165.0;
                moonweigth = earthweight * 0.17;
                Console.WriteLine(earthweight + " earth-pounds is equivalent to " + moonweigth + " moon-pounds.");
            }
        }
     
     
    /* Program to convert Fahrenheit to Celsius */
    using System;
    class FtoC
    {
        static void Main()
        {
            double f;
            double c;
            f = 59.0;
            c = 5.0 / 9.0 * (f - 32.0);
            Console.Write(f + " degrees fahrenheit is ");
            Console.WriteLine(c + " degree celsius.");
        }
    }




    Basic things that a beginners must know about C-Sharp (C#)





    Java is a structured, object-oriented language derived from c++. Java achieved portability by translating the program’s source code into an intermediate language called bytecode. This bytecode was then executed by the Java Virtual Machine (JVM). Therefore, a Java program could run in any environment for which a JVM was available.



    The creation of C#:



    Features that lack Java:

    1. Cross-language interoperability, also called mixed-language programming.

    This is the ability for the code produced by one language to work easily with the code produced by another.

    1. Full integration with the windows platform.

    Although Java programs can be executed in a windows environment (assuming JVM has been installed), Java and Windows are not closely coupled.



    To overcome the above mentioned, Microsoft developed C#. From C, C# derives its syntax, many of its keywords and operators. C# builds upon and improves the object model defined by C++.





    How the Common Language Runtime Works



    The Common Language Runtime (CLR) manages the execution of .NET code. When you compile a C# program, the output of the compiler is not executable code. Instead, it is a file that contains a special type of pseudocode called Microsoft intermediate Language (MSIL). MSIL defines a set of instructions that are independent of any specific CPU. It is the job of the CLR to translate the intermediate code into executable code when a program is run.



    MSIL is turned into executable code using a JIT (Just in time) compiler. When a .NET program is executed, the CLR activates the JIT compiler. The JIT compiler converts MSIL.

No comments:

Post a Comment