Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #define MAX 100
- //17. Exiba a quantidade de caracteres do nome do usuário.
- int main()
- {
- char nome[MAX];
- int i,cont=0;
- printf("\n Digite um nome: ");
- __fpurge(stdin);
- fgets(nome,MAX,stdin);
- for(i=0;i<strlen(nome);i++)
- {
- if((nome[i]>= 'a' && nome[i]<='z')||(nome[i]>='A'&&nome[i]<='Z'))
- {
- cont++;
- }
- }
- printf("\n Tamanho do nome: %d",cont);
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement