• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
#include <stdio.h>#include <conio.h>int main(){int vocales=0;int consonantes=0;int todos=0;printf("Que quieres contar?\n");printf("1-Las vocales.\n");printf("2-Las consonantes.\n");printf("3-Todas las letras de la frase.\n");printf("\n");printf("-> ");int a;a = getchar();switch (a){case '1':printf("Introduce la frase: ");char textoa[1001];scanf("%s", &textoa);char *p;p = textoa;while (*p != '\0'){if (*p == 'a' || *p == 'e' || *p == 'i' || *p == 'o' || *p == 'u' || *p == 'A' || *p == 'E' || *p =='I' || *p == 'O' || *p == 'U') vocales ++;p++;}printf("Hay %d vocales.", vocales);break;case '2':printf("Introduce la frase: ");char textob[1001];scanf("%s", &textob);p = textob;while (*p != '\0'){if (*p == 'b' || *p == 'B' || *p == 'c' || *p == 'C' || *p == 'd' || *p == 'D' || *p == 'f' || *p =='F' || *p == 'g' || *p == 'G' || *p == 'h' || *p == 'H' || *p == 'j' || *p == 'J' || *p == 'k' || *p == 'K' || *p =='l' || *p == 'L' || *p == 'm' || *p == 'M' || *p == 'n' || *p == 'N' || *p == 'ñ' || *p == 'Ñ' || *p == 'p' || *p== 'P' || *p == 'q' || *p == 'Q' || *p == 'r' || *p == 'R' || *p == 's' || *p == 'S' || *p == 't' || *p == 'T' || *p== 'v' || *p == 'V' || *p == 'w' || *p == 'W' || *p == 'x' || *p == 'X' || *p == 'y' || *p == 'Y' || *p == 'z' ||*p == 'Z') consonantes ++;p++;}printf("Hay %d consonantes.", consonantes);break;case '3':printf("Introduce la frase: ");char textoc[1001];
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...