Solución
1 |
|
#include
<stdio.h>
int
main()
{
char
vocal;
printf( "\n
Introduzca una vocal minuscula: " );
scanf( "%c",
&vocal );
switch
( vocal )
{
case
'a' : printf( "\n
A" );
break;
case
'e' : printf( "\n
E" );
break;
case
'i' : printf( "\n
I" );
break;
case
'o' : printf( "\n
O" );
break;
case
'u' : printf( "\n
U" );
break;
default
: printf( "\n
ERROR: '%c' no es una vocal minuscula.",
vocal );
}
return
0;
} |
|
|
Solución
2 |
|
#include
<stdio.h>
int
main()
{
char
mayuscula, vocal;
printf( "\n
Introduzca una vocal minuscula: " );
scanf( "%c",
&vocal );
switch
( vocal )
{
case
'a' : mayuscula = 'A';
break;
case
'e' : mayuscula = 'E';
break;
case
'i' : mayuscula = 'I';
break;
case
'o' : mayuscula = 'O';
break;
case
'u' : mayuscula = 'U';
}
if
( vocal == 'a' || vocal == 'e' || vocal == 'i' || vocal == 'o' ||
vocal == 'u' )
printf( "\n
%c", mayuscula );
else
printf( "\n
ERROR: '%c' no es una vocal minuscula.", vocal );
return
0;
} |
|
|
Ficheros
con extensión (.c) |
|
|
|
|
|