ASP.NET MVC, MVC, C#, PYTHON, JQUERY

Thursday, September 13, 2018

Half pyramid program for fibonacci series



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

namespace fibonaccipyramid
{
    class Program
    {
        static void Main(string[] args)
        {
            int i,a=0,b=1,n,c,j,k;
            Console.WriteLine("Enter the limit");
            n=Convert.ToInt32(Console.ReadLine());
            Console.WriteLine(a);
            Console.WriteLine(b);
            for (i = 1; i <= n; i++)
            {
         
                for (j = 1; j <= i; j++)
                {
               
                        c = a + b;
                        a = b;
                        b = c;

                        Console.Write(c);
                        Console.Write("\t");
               
            }
                Console.Write("\n");
            } Console.ReadLine();
        }
    }
}



Share:

Wednesday, September 12, 2018

Factorial program using recursion in c#




We have come across the situations where a function calls another function but there is one more possibility that a function calls itself.
When a function calls itself it is known as recursion. It is usually used where we have to repeat a process again and again.
The following program for finding factorial using recursion is an example of recursive function and its implementation.

  1. using System;    
  2.     
  3. namespace Recursion_Example   
  4. {    
  5.     class Program    
  6.     {    
  7.         static void Main(string[] args)    
  8.         {    
  9.            int n;
  10.             Console.WriteLine("Enter the Number");    
  11.     
  12.                
  13.              n =Convert.ToInt32(Console.ReadLine());     //read number from user
  14.     
  15.             double factorial = Factorial(n);    //invoke the static method    
  16.     
  17.             //print the factorial result    
  18.             Console.WriteLine("factorial of"+n+"="+factorial.ToString());    
  19.     
  20.         }    
  21.         public static double Factorial(int n)    
  22.         {    
  23.             if (n == 0)    
  24.                 return 1;    
  25.             return n * Factorial(n-1);//Recursive call    
  26.     
  27.         }    
  28.     }    
  29. }    
Share:

Friday, September 7, 2018

Main() Method In C#

Main() Method In C# 

Hello Friends In this article we will learn about What is Main() Method in C#.



  • Main() Method is an entry point of an application.
  • Main () Method means That execution of code start from Main() method.
  • When an application starts Execution C# compiler looks for in the source file is the Main() method.
  • You must include Main () method in a class make your program executable.


Example:-

public Class HelloCsharp
{
public static void Main(string[] args)  //Main () method 
System.Console.WriteLine("Hello Friends Welcome To Csharp4tech");
}
}
Share:

How to Find Factorial Using C#

            How to Find Factorial  Using C#

using System;
namespace FactorialDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            int iCount, iUserNumber, iFact;
            Console.WriteLine("Please Enter A Number For Finding Factorial ");
            iUserNumber = Convert.ToInt32(Console.ReadLine());
            iFact = iUserNumber;
            for (iCount = iUserNumber  - 1; iCount &gt;= 1; iCount--)
            {
                iFact = iFact * iCount;
            }
            Console.WriteLine("Factorial of Entered Number {0}", iFact);
            Console.ReadLine();
        }
    }
}
Share:

C# Programming Structure

Classes in C#

C# classes are the primary building blocks of the language.C#  also provides some predefined set of classes and methods.These classes and Methods Provides various basis functionalities that you may want to implement in your Application.
Creating  First "Hello World" Program
Using System;
public class Hello
{
public static void Main(string []args)
{
         
Console.WriteLine("Hello,World!! \n");
            Console.ReadLine();
}
}


Let us look at the various parts of the given Program:
 The First Line of program using System; the using keyword is used to includes the System  namespace in the program.A program has multiple using statements.

 In the Code Class Declaration includes the method, Main() That Will display the message  ,"Hello,World !!" on your screen.

The next line defines the Main methods which is the entry point for all C# programs.The Main methods states what the class does when executed.

Some C# point -

  •    C# is case Sensitive 
  •  All statement and Expression must end with a semicolon(;).
  • The program start execution from " Main" Method.
Share:

Introduction to C#

C# is a Programming Language developed by Microsoft and approved by the European Computer Manufacturers Association (ECMA) and International Standards Organization (ISO). C# is modern general-purpose, Object-Oriented Programming Language. C# is developed by Anders Hejlsberg and his team during the development of.Net framework.
C# is designed for Common Language Infrastructure (CLI), Which consists of the executable code and runtime environment that allows the use of various high-level  Language on Different Computer platform and architectures

Integrated Development Environment (IDE) for C#
Microsoft provides Development tools for  C# Programming:

  • Visual Studio 2010 
  • Visual C# 2010 Express 
  • Visual Studio 2012
  • Visual Web Developer 
Share:

Exploring ASP.NET MVC

   Exploring ASP.NET MVC

MVC

The MVC Model is an alternate to the ASP.NET web forms Model For developing web application .It is a light weight model and Support Exiting ASP.NET Feature.It Separates the Following three main Components From application 

 Model - 

Refers to a set of classes that describe the data that the application work with .In addition these classes define the business  Logic that governs how to data can be manipulated.

View -

Refer to the components that defines an application user Interface.For Example ,Login that contains text boxes and buttons.
Share:

SOCIAL PROFILES

Search This Blog

Powered by Blogger.

Fixed Menu (yes/no)

yes

Contact Form

Name

Email *

Message *

Tags

Ads Section

Tags

ASP.NET MVC (7) C# (11) jQuery (1)