Advertisement
derazanother

test1

Feb 5th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. char ch[10];
  2. #include <stdio.h>
  3. int main(){
  4. int n,c=0,i;
  5. char ch[10],d[10];
  6.         void update(char[10],int);
  7.         do{
  8.             printf("Enter a String (4-10): ");
  9.             __fpurge(stdin);
  10.             gets(ch);
  11.             n = strlen(ch);
  12.            
  13. }while(n<4||n>10);
  14.         printf("String \"%s\" wii be replaced the consonant with '+' and convert vowel to upper case.\n ",ch);
  15.     printf("Output ");
  16.     for(i=0;i<n;i++){
  17.     if(ch[i] == 'a'||ch[i] == 'e'||ch[i] == 'i'||ch[i] == 'o'||ch[i] == 'u'){
  18.     d[i] = toupper(ch[i]);
  19.         printf("%c",d[i]);
  20.         c++;
  21.     }
  22.         else {
  23.         printf("+");
  24.         }
  25.     }
  26.    
  27.  
  28. return (0);
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement