- #1
stellina
- 8
- 0
Hi guys!
I am writing a program that reads in a single sentence up to the period. The program outputs the modified sentence with all of the spaces removed and replaces each of the vowels with the letter 'Z'.
Here is my code but I am stuck and I don't understand what's wrong, can anyone help?Thanks!
#include <stdio.h>
#define SPACE ' '
int main(void)
{
char c;
char a,e,i,o,u;
char A,E,I,O,U;
char Z;
c = getchar();
a=e=i=o=u=0;
A=E=I=O=U=0;
Z = 0;
printf("Enter text to be analyzed:");
while ((c= getchar() !='.'))
{
if (c == SPACE)
putchar(c+1);
if (c == a|| c == e|| c == i|| c == o|| c== u|| c== A|| c==E||c== I|| c== O|| c== U)
putchar(Z);
}
putchar(c);
return 0;
}
I am writing a program that reads in a single sentence up to the period. The program outputs the modified sentence with all of the spaces removed and replaces each of the vowels with the letter 'Z'.
Here is my code but I am stuck and I don't understand what's wrong, can anyone help?Thanks!
#include <stdio.h>
#define SPACE ' '
int main(void)
{
char c;
char a,e,i,o,u;
char A,E,I,O,U;
char Z;
c = getchar();
a=e=i=o=u=0;
A=E=I=O=U=0;
Z = 0;
printf("Enter text to be analyzed:");
while ((c= getchar() !='.'))
{
if (c == SPACE)
putchar(c+1);
if (c == a|| c == e|| c == i|| c == o|| c== u|| c== A|| c==E||c== I|| c== O|| c== U)
putchar(Z);
}
putchar(c);
return 0;
}