In: Computer Science
Write a value returning function named CountLower that counts the number of lower case letters on one line of standard input and returns that number. Document the dataflow of the function and show how it would be called from main().
ANSWER:-
#include <stdio.h>
int countLower(char str[]){
int count = 0,i;
for(i<0;str[i]!='\0';i++){
if(str[i]>='a' &&
str[i]<='z'){
count++;
}
}
return count;
}
main(){
char str[100];
printf("Enter string: ");
// gets function is to read a line of input string, it
terminates whenever \n is encountered
gets(str);
printf("No of lowercase letters is
%d",countLower(str));
}
OUTPUT:-
DATAFLOW:
Note:- If you have any queries, please comment below. THANK YOU!!!! Please give positive rating.