PROGRAM USING C ********************************************************************************** * //program to convert the paragraph,s every first letter int uppercase run it using c language #include<stdio.h> #include #include<string.h> #include void main() { clrscr(); int length=0,i,n,j,s; char str[80][80]; //declare sting of 80 words for one line printf("enter how many lines of passage you want to enter"); scanf("%d",&n); printf("enter the passage\n"); for(i=0;i<=n;i++) //loop to get character of n line as you declare { gets(str[i]); } for(i=1;i<=n;i++) { length=length+strlen(str[i]); //checks how much words u entered including balnkspaces & enter key } for(i=1;i<=n;i++) { for(j=0;j<=length;) { if(j==0 && i<=n) { for(;str[i][j]==' ';) { j++; } if(str[i][j]>='a' && str[i][j]<='z') { str[i][j]=_toupper(str[i][j]); //convert alphabet to uppercase j++; continue; } else { j++; } } else if(str[i][j]>='a' && str[i][j]<='z') { j++; continue; } else if (str[i][j]==' ') { for(;str[i][j]==' ';) {
j++; } if(str[i][j]>='a' && str[i][j]<='z') { str[i][j]=_toupper(str[i][j]); j++; continue; } else { j++; } } else j++; } } for(i=1;i<=n;i++) { puts(str[i]);//show the paragrap after conversions } getch(); } ********************************************************************************** * 1. In above program I have use <stdlib.h> file because the function _toupper is present in it 2. when u enter the paragraph, then one line of paragraph can hold 80 character including blankspace but if you press enter key it read as new line. like hello dear, I miss u. here 2 lines are entered ,first line conatin 11 characeter while second line contain 9 character. TRY THIS PROGRAM!