Monday, September 14, 2015

Upper case Converter in Turbo Pascal

The first programming language that I have learned how to program is Pascal I am using Turbo Pascal 5 as my IDE and compiler. In this article I would like to share with you a sample program that I wrote using Turbo Pascal I called this program upper case converter in Turbo Pascal. What does the program will do is to ask the user a word or a string and then it will convert the word or a string into upper case letters.

If you  have some questions please send me an email at jake.r.pomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.




Sample Program Output


Program Listing

Program Upper_Case;
Uses Crt;

Const
 LCLetters : Set of Char = ['a'..'z'];

Var
 InpStr : String;
 Size,I : Integer;

 Begin                                                          
  Clrscr;
  Write('Upper Case Converter');
  Writeln; Writeln;
  Write('Enter a String :=> ');
  Readln(InpStr);
  Size := Length(InpStr);
   For I := 1 To Size Do
   Begin
    If InpStr[I] IN LCLetters Then
      InpStr[I] := UpCase(InpStr[I]);
   End;
   Writeln; Writeln;
   Writeln('The Converted String is ' ,InpStr,'.');
   Readln;
 End.


No comments:

Post a Comment