How to make the last name first letter. Capital in this program
#include<string.h> #include<stdio.h> #include <iostream> using namespace std; int main() { char str[25][150],t[20]; int i,n,j; cout<<" Enter the number of name "; cin>>n; cout<<"\n Enter Names : \n\n"; for(i=-1;i<n;i++) { cin.getline(str[i], 100); } for(i=0; i<n; i++) { str[i][0]=toupper(str[i][0]); } for(i=1; i<n; i++) { for(j=1; j<n; j++) { if(strcmp(str[j-1], str[j])>0) { strcpy(t, str[j-1]); strcpy(str[j-1], str[j]); strcpy(str[j], t); } } } cout<<"\n Names Sorted in Alphabetical Order : \n\n"; for(i=0; i<n; i++) { cout<<" "; cout<<str[i]<<"\n"; } r