Skip to main content

Posts

Showing posts from August 27, 2014

Program in C sharp # to merge two numbers and findest nearest vowel to a inputted character ( question from bca previous year question paper very important )

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace npgc {    static  class math     {         public static string nearest(char ch)         {             int i=0;             int j=(int)ch;             string ret="";             char[] arr = {'a','e','i','o','u'};             for (i=0;i< arr.Length - 1; i++)             {                 int tmp=(int)(arr[i]);              int tmp2=(int)arr[i+1];              if (j < tmp2)              {                  int a = j - tmp;                  int b = tmp2 - j;                                  if (a == b)                      ret += arr[i] +""+ arr[i + 1];                                      else if (a > b)                      ret += arr[i + 1];                  else                      ret += arr[i];                  return ret;              }             }             ret += arr[arr.Le