Horje
sum of two numbers in c# Code Example
add two numbers in c#
using System;

namespace Add{
	public class Program{

		public static int addition(int a, int b){
			return (a+b);
		}

		public static void Main(){
			int a,b;
			int sum;

			Console.Write("Enter first number: ");
			a = Convert.ToInt32(Console.ReadLine());

			Console.Write("Enter second number: ");
			b = Convert.ToInt32(Console.ReadLine());

			sum = addition(a,b);

			Console.WriteLine("Sum is: " + sum);
		}
	}
}
sum of two numbers in c#
int num = 123;
int sum = 0;
while(num > 0)
{
  sum += number % 10;
  num /= 10;
}
Console.WriteLine(sum); // output: 6




Csharp

Related
how to make a pause feautre in unity Code Example how to make a pause feautre in unity Code Example
unity3d quaternion add 90 degrees Code Example unity3d quaternion add 90 degrees Code Example
C++ in C# Code Example C++ in C# Code Example
set ads for children admob unity Code Example set ads for children admob unity Code Example
c# set file invisible Code Example c# set file invisible Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7