How to find realtion b/w 2 persons using their names???
hello all,
this is one of its quite intersting program by using a tag word "FLAMES"Where we can find the relation of the 2 persons.
just take 2 names "naveen" and "sanjana",while comparing the 2 strings we have to delete the equal characters and the we have switch case where we have to count the characters in the remain string
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication11
{
class Program
{
static void Main(string[] args)
{
int a, count = 0;
Console.WriteLine("Enter First String");
string first = Console.ReadLine();
Console.WriteLine("Enter Second string");
string second = Console.ReadLine();
StringBuilder str = new StringBuilder();
foreach (char ch in first)
{
if (second.ToString().IndexOf(ch) < 0)
{
str.Append(ch);
count++;
}
}
foreach (char ch2 in second)
{
if (first.ToString().IndexOf(ch2) < 0)
{
str.Append(ch2);
count++;
}
}
Console.WriteLine(str.ToString());
Console.WriteLine(count);
a= count % 6;
Console.WriteLine(a);
switch (a)
{
case 1: Console.WriteLine("friends");
break;
case 2: Console.WriteLine("lovers");
break;
case 3: Console.WriteLine("affection");
break;
case 4: Console.WriteLine("marriege");
break;
case 5: Console.WriteLine("enemy");
break;
case 6: Console.WriteLine("sisters");
break;
}
Console.ReadLine();
}
}
}
NICE WORK