Skip to content

Instantly share code, notes, and snippets.

View ramjill's full-sized avatar

ramakrishnan ramjill

  • First american india pvt ltd
  • salem
View GitHub Profile
@ramjill
ramjill / Challenge.cs
Created September 19, 2012 09:10
Given an input string (of no more than 300 characters in length), parse the string and count the occurrences of vowels and consonants. The data should be output in the format below. Punctuation should be ignored. {vowels:<count>,consonants:<count>} eg:
public class Challenge
{
public static void Main()
{
Console.WriteLine("Enter String Name");
string inputString = Console.ReadLine();
string alphabet = new String(inputString.Where(Char.IsLetter).ToArray());
int vowel = CountVowels(alphabet);
int consonants = CountConsonants(alphabet);
Console.WriteLine("{0}vowels:{1},consonants:{2}{3}", "{", vowel, consonants, "}");
@ramjill
ramjill / Challenge.cs
Created September 19, 2012 09:16 — forked from coderdan/gist:3747255
Codehire Cup Skeleton Code for C#
public class Challenge
{
public static void Main()
{
Console.WriteLine("Enter String Name");
string inputString = Console.ReadLine();
string alphabet = new String(inputString.Where(Char.IsLetter).ToArray());
int vowel = CountVowels(alphabet);
int consonants = CountConsonants(alphabet);
Console.WriteLine("{0}vowels:{1},consonants:{2}{3}", "{", vowel, consonants, "}");
@ramjill
ramjill / gist:3766475
Created September 22, 2012 15:13 — forked from coderdan/gist:3747255
Codehire Cup Skeleton Code for C#
public class Challenge {
public static void Main() {
Output.Write(Input.Read());
}
}