Month: December 2016

Download/Upload files using FTP in C#

        What is FTP?  FTP(File transfer protocol)  is a client-server protocol that relies on two communications channels between client and server: a command channel for controlling the conversation and a data channel […]

Interface vs Abstract class in C#

What is Interface? An interface is a contract with the list of the method defined in the interface.An interface can only have the method definition.Any class implementing the interface should implement all the methods defined […]

Swap two variable without using the third variable

using System; namespace Swap { class Program { private static void Main(string[] args) { int a = 1000; int b = 999; Console.WriteLine(“Before Swap”); Console.WriteLine(“Value of A :{0} “, a); Console.WriteLine(“Value of B :{0} “, […]

Sum of digits till the sum is one-digit number

public class SumtillDigitOne { private long _sum = 0; public long SumAllNumberTillDigitOne(long bigno) { if (bigno == 0) { if (_sum > 9) { bigno = _sum; _sum = 0; } else { return _sum; […]