write a C program which repeatedly reads in sentences from the user and reports on how many capital letters are in the sentence and how many punctuation characters. Your program will stop asking for input once the user has entered in a blank line.
Consider the following example usage with the program. User input is marked in underline:
Enter a sentence: John and Mary went to Fred's house.
You used 3 capital letters and 2 punctuation characters.
Enter a sentence: I like A&W more than McDonald's.
You used 5 capital letters and 3 punctuation characters.
Enter a sentence:
Good bye!

Hint: make use of the standard C functions ispunct and isupper.

Other requirements

You must make two functions.

  1. Make a function called find_characters, which has a return type of void, and which hase three parameters: one of type char * (a string to find characters in), one of type int * (a reference to int variable indicating how many capital letters are in the string) and the last one also of type int * (a reference to an int variable indicating how many punctuation characters are in the string). Your find_characters function should scan the string and update the two variables it has references to.
  2. Make a main function. This function should repeatedly read in a string from the user, call your find_characters function, and output the information returned to it by the find_characters function indicating how many capital letters and how many punctuation characters were in the string. Your main function should stop reading in input when the user enters in a blank string (i.e., the user just hits enter without entering anything else in). You may assume that the user will not enter in a sentence longer than 100 characters



This is what i did so far.. help me out
Code:
#include<stdio.h>
#include<stdlib.h>
#include<ctype.h>
#include<string.h>


int main(void) 
{  
	int i;
	char str[100];
	printf("\nEnter The String : ");


 	while(scanf("%99[^\n]s", str) == 1){
		int upper_case = 0;
		int punctuation = 0;


		for(i = 0; i <= (int) strlen(str)-1;i++){
			if (isupper(str[i])){
				upper_case++;
      		}
      		if (ispunct(str[i])){
        		punctuation++;
      		}
		}


		printf("\nUppercase Letters : %d", upper_case);
    	printf("\npunctuation : %d\n", punctuation);
    	printf("------------------------\n\nEnter The String : \n");
	
 	}
	return (0);
}