Write an Pascal Program For Dynamic Strings - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Saturday, September 23, 2017

Write an Pascal Program For Dynamic Strings


Dynamic String Allocation

Program:
program exString;
var
greetings: string;
name: packed array [1..10] of char;
organisation: string[10];
message: pchar;

begin
greetings := 'Hello ';
message := 'Good Day!';

writeln('Please Enter your Name');
readln(name);

writeln('Please Enter the name of your Organisation');
readln(organisation);

writeln(greetings, name, ' from ', organisation);
writeln(message);
end.

Output:
Please Enter your Name
John Smith
Please Enter the name of your Organisation
Oracle

Hello John Smith from Oracle

No comments:

Post a Comment