Ritu

  • Uploaded by: ritu bansal
  • 0
  • 0
  • December 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Ritu as PDF for free.

More details

  • Words: 230
  • Pages: 2
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!

Related Documents

Ritu
October 2019 11
Ritu
December 2019 18
Ritu
April 2020 7
Ritu Hw.docx
December 2019 17
Ritu Varma.pdf
April 2020 10
Ritu Projct.docx
May 2020 6

More Documents from "RITU SAHNI"

Ritu
December 2019 18
Certification Test
November 2019 42
Siemens.docx
August 2019 34
Ke Recovery System.pdf
December 2019 38
Venture Capital.pdf
May 2020 17