/*Programa que crea un array de caracteres N
Num_vocal (EJ. a=5, e=1, i=0, o=2, u=1) (En la misma funcion imprima la informacion)
Simbolos diferentes genere un vector con los simbolos diferentes a las letras
Imprimir Vector original, Vectos simbolos diferentes, Vector en mayusculas
Convertir vector original en mayusculas*/
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
char car[100], dif[100], may[100];
int N, A, E, I, O, U, K, CV;
void inicio (int n)
{
printf ("Escribe el numero de caracteres a ingresar ");
scanf ("%d", &n);
}
void captura (int n, int a=0, int e=0, int i=0, int o=0, int u=0, int k=0, int cv=0, char ASD[100])
{
int j;
for (j=0; j<n; j++)
{
printf ("\nEscribe el caracter %d ", j+1);
car[j] = getche ();
switch (car[j])
{
case 'A':
case 'a': a++;
cv++;
break;
case 'E':
case 'e': e++;
cv++;
break;
case 'I':
case 'i': i++;
cv++;
break;
case 'O':
case 'o': o++;
cv++;
break;
case 'U':
case 'u': u++;
cv++;
break;
default: if (car[j]!='b' && car[j]!='B' && car[j]!='c' && car[j]!='C' && car[j]!='d' && car[j]!='D' && car[j]!='f' && car[j]!='F' && car[j]!='g' && car[j]!='G' && car[j]!='h' && car[j]!='H' && car[j]!='j' && car[j]!='J' && car[j]!='k' && car[j]!='K' && car[j]!='l' && car[j]!='L' && car[j]!='m' && car[j]!='M' && car[j]!='n' && car[j]!='N' && car[j]!='ñ' && car[j]!='Ñ' && car[j]!='p' && car[j]!='P' && car[j]!='q' && car[j]!='Q' && car[j]!='r' && car[j]!='R' && car[j]!='s' && car[j]!='S' && car[j]!='t' && car[j]!='T' && car[j]!='v' && car[j]!='V' && car[j]!='w' && car[j]!='W' && car[j]!='x' && car[j]!='X' && car[j]!='y' && car[j]!='Y' && car[j]!='z' && car[j]!='Z')
dif[k] = car[j];
k++;
}
}
printf ("\n\nCANTIDAD DE VOCALES: %d \n", cv);
printf ("a = %d e = %d i = %d o = %d u = %d", a, e, i, o, u);
printf ("\n\nARREGLO SIMBOLOS DIFERENTES \n");
for (j=0; j<k; j++)
printf ("%c ", ASD[j]);
}
void imprimir (char AO[100], char AEM[100], int n)
{
int j;
printf ("\n\nARREGLO ORIGINAL \n");
for (j=0; j<n; j++)
printf ("%c ", AO[j]);
printf ("\n\nARREGLO EN MAYUSCULAS \n");
for (j=0; j<n; j++)
{
may[j] = toupper (car[j]);
printf ("%c ", AEM[j]);
}
}
void main ()
{
inicio (N);
captura (N, A, E, I, O, U, K, CV, dif);
imprimir (car, may, N);
}