Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int i,j=0,d=0;
  6. char a[50],b[50];
  7. cout<<"Enter the input"<<endl;
  8. cin>>a;
  9. for(i=0;a[i]!='\0';i++)
  10.  
  11. {
  12. if((a[i]>=0&&a[i]<=64)||(a[i]>=91&&a[i]<=96)||(a[i]>=123&&a[i]<=255))
  13. {
  14. b[d]=a[i];
  15. d++;
  16. }
  17.  
  18. else if(a[i]!='a'&&a[i]!='U'&&a[i]!='O'&&a[i]!='I'&&a[i]!='E'&&a[i]!='A'&&a[i]!='u'&&a[i]!='o'&&a[i]!='i'&&a[i]!='e')
  19. {
  20. b[d]='#';
  21. d++;
  22. b[d]=a[i];
  23. d++;
  24. }
  25.  
  26. }
  27.  
  28. for(i=0;i<d;i++)
  29.  
  30. {
  31. if (b[i]>='a'&&b[i]<='z')
  32. b[i]=b[i]-32;
  33. else if (b[i]>='A'&&b[i]<='Z')
  34. b[i]=b[i]+32;
  35. else b[i]=b[i];
  36. }
  37.  
  38. for(i=0;i<d;i++)
  39. cout<<b[i];
  40. cout<<endl;
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement