AedenCak3

C program to print a new string without VOWELS

Dec 8th, 2021
961
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.58 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<string.h>
  3.  
  4. int main()
  5. {
  6.     char input[100], output[100];
  7.     int length,x=0;
  8.     printf("Enter a sentence : ");
  9.     gets(input);
  10.  
  11.     length = strlen(input);
  12.  
  13.  
  14.     for(int i=0; i<length; i++)
  15.     {
  16.         if(input[i]=='a'||input[i]=='e' ||input[i]=='i' ||input[i]=='o' ||input[i]=='u' ||input[i]=='A' ||input[i]=='E' ||input[i]=='I' ||input[i]=='O' ||input[i]=='U' )
  17.  
  18.             continue;
  19.  
  20.         else
  21.         {
  22.  
  23.             output[x]=input[i];
  24.             x++;
  25.         }
  26.  
  27.     }
  28.     printf("Final Result : %s", output);
  29.  
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment