Hello. I am making program which count lowercase letters in a string. So far i have this but scanf stop after first word if string have spaces. Also I want to make that program count only letters which are not count i mean how many different lowercase letters in a string. Can somebody help to do this?
Code:
#include<stdio.h>
#include<string.h>
#include <stdlib.h>
int main(){
char s[80];
int count=0;int i=0;
printf("enter string:\n");
scanf("%s",s);
for( ;i<strlen(s); ++i)
if ((int)s[i]>=97 && (int)s[i]<=122){
count+=1;
}
printf("%d ", count, strlen(s));
system ("pause");
return 0;
}