Monday, July 31, 2017

Display string after deleting vowels in it in C

#include<stdio.h>
void main()
{
    char str[50],i;
    printf("Enter a string : ");
    gets(str);

    printf("\nAfter deleting vowels :\t");

    for(i=0;str[i]!='\0';i++)
    {
        if(str[i]=='a'||str[i]=='A'||str[i]=='e'||str[i]=='E'||str[i]=='i'||str[i]=='I'||str[i]=='o'||str[i]=='O'||str[i]=='u'||str[i]=='U')
        {
            continue;
        }
        else
        {
            printf("%c",str[i]);
        }
    }
    getch();
}

Related Posts:

  • Display string after deleting vowels in it in C#include<stdio.h> void main() {     char str[50],i;     printf("Enter a string : ");     gets(str);     printf("\nAfter deleting vowels :\t");     for(i=0;str[i]!='\0'… Read More
  • Concatenation of two string in C#include<stdio.h> void catstr(char [],char []); void main() {     char str1[50],str2[50];     printf("Enter 1st string (str1) :");     gets(str1);     printf("\nEnter 2nd string (… Read More
  • Count no. of words in a sentence in C#include<stdio.h> void main() {     char str[50],i,wordcount=0;     printf("Enter a line of text : ");     gets(str);     for(i=0;str[i]!='\0';i++)     {     &… Read More
  • Sorting names in C#include<stdio.h> //#include<string.h> void copystring(char txt1[], char txt2[]) {     int k;     for(k=0;txt2[k]!='\0';k++)     {         txt1[k]=txt2[k];  … Read More
  • Copying string 2 to string 1#include<stdio.h> void copystr(char [],char []); void main() {     char str1[50],str2[50];     printf("Enter 1st string,str1 : ");     gets(str1);     printf("\nEnter 2nd string,s… Read More

0 comments:

Post a Comment