banner image

ZOHO c program -twice the vowel

Twice the Vowel



Problem Statement



If a vowel is found in the given string twice that vowel character of a string in the same array efficiently.



Input Format



The first line contains the number of test cases T. Next T lines contains an input string.



Output Format



Print the modified string.



Sample Input



1

Tamil



Sample Output



Taamiil



Code:




#include<stdio.h>

int check_vowel(char);



int main()

{

  char s[100];

  int i, j = 0;

    int count=0;

    int n;

    scanf("%s",s);

    n=strlen(s);



printf("%d%s",n,s);

 for(i = 0; i<n; i++)

  {

    if(check_vowel(s[i])==1)

       

    {

        for(j=n-1;j>=i;j--){

            s[j+1]=s[j];}

        i++;

    }

    n++;

      }

   



  printf("String after repeating vowels: %s\n", s);

  return 0;

}





int check_vowel(char c)

{

  switch(c) {

    case 'a':

    case 'A':

    case 'e':

    case 'E':

    case 'i':

    case 'I':

    case 'o':

    case 'O':

    case 'u':

    case 'U':

      return 1;

      break;

    default:

      return 0;

  }}



ZOHO c program -twice the vowel ZOHO c program -twice the vowel Reviewed by astin salvi on 1:26 AM Rating: 5

No comments:

Powered by Blogger.