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);

        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

Top Online Courses From ProgrammingKnowledge

Python Course
Java Course
Bash Course
Linux Course
C Course
C++ Course
PHP Course
Android Course
C# Course
JavaFx Course
NodeJs Course
Jenkins Course
Scala Course
Bootstrap Course
MongoDB Course
QT C++ GUI Course