#include <cstdlib> #include <iostream> #include<conio.h> #include<string.h> using namespace std; int main() { int upper=0; string s; int i; cout<<"Enter a String"; cin>>s; for(i=0;i<=s.size();i++) { if(s[i]>='A'&& s[i]<='Z') { upper++; } } int len=s.length(); cout<<" The Number of Upper case Letter is"<<upper; cout<<"length"<<len; getch(); return 0; }
cin >> s;
getline
cout<<"Enter a String"; cin>>s;
cout<<"Enter a String"; getline(cin, s);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)