Your IP : 216.73.216.40


Current Path : /var/www/html/bibhas.ghoshal/ITP_2019/lab/
Upload File :
Current File : /var/www/html/bibhas.ghoshal/ITP_2019/lab/count_uppercase.c

/* Read a line of text and count the number of uppercase letters */

#include <stdio.h>
#include <string.h>

int main()
{
	char line[81];
	int i, n, count=0;
	scanf ("%[^\n]", line);
	n = strlen (line);
	for (i=0; i<n; i++)
	{
		if (isupper(line[i]))
		{
			count++;
		}
	}		
	printf ("\n The number of uppercase letters in the string %s is %d\n", line, count);
}