Saturday, June 28, 2014

C# Tutorial for Beginners 12 - Method Passing Parameters and Return







using System;
namespace MyProject.Examples
{
    class ExampleOne
    {
        public static void Main()
        {
            int num1 = 0, num2 = 0;
            //Accepting Values from users
            Console.Write("Enter first number\t\t");
            num1 = Convert.ToInt32(Console.ReadLine());

            Console.Write("\n\nEnter second number\t\t");
            num2 = Convert.ToInt32(Console.ReadLine());


                ExampleOne eOne=new ExampleOne();
                eOne.sum(num1, num2);
            
                Console.ReadKey();
        }

        public int sum(int no1,int no2)
        {
          
            int add = no1 + no2;
            return add;
            //
        }
    }
}
















------------------------------------

Passing Parameters C# Programming

C# Passing Parameters by Reference

How are parameters passed in C#?

ref (C# Reference)

Passing Reference-Type Parameters

Method Parameters (C# Reference)

Searches related to method parameters and return in c#

c# return multiple parameters

c# optional method parameters

c# method parameters array

c# method parameters optional

c# thread method with parameters

c# invoke method with parameters

c# get method parameters

c# default method parameters
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ