hamzajaved

Input String and increment

Dec 11th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.84 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace string_rotation
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             //input string and increment
  14.             string str = Console.ReadLine();
  15.             string str1 = "";
  16.             char[] c = str.ToCharArray();
  17.  
  18.             for (int i = 0; i < str.Length; i++)
  19.             {
  20.                 char temp = ++c[i];
  21.                 if(temp == 'a' || temp == 'e' || temp =='i' || temp == 'o' || temp == 'u')
  22.                 {
  23.                     str1 += temp.ToString().ToUpper();
  24.                 }
  25.                 else
  26.                 {
  27.                     str1 += temp;
  28.                 }
  29.             }
  30.             Console.WriteLine(str1);
  31.          
  32.         }
  33.     }
  34. }
Add Comment
Please, Sign In to add comment