Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Using name variable in pascal writeln sentance.

+1 vote
asked Sep 8, 2023 by Evelyn Resendiz Villalobos (130 points)

Im using pascal. The program i'm making ask the user for their name, after we use that name in a question. Ex: (User types name "Steve". Next line is writeln( 'Steve, what s your favorite color?'). How do I use the variable and include it in my writeln sentance. I'm not use how to write that line of code.sad

1 Answer

0 votes
answered Sep 8, 2023 by Peter Minarik (86,240 points)

I've put together a(n intentionally) different little Pascal program that shows you how to print variables and text together.

Use the analogy to solve your problem.

If you still have issues, share the code you have so far.

Here's the example:

program Hello;
var name: String;
begin
    name := 'Kitty';
    writeln('Hello, ', name, '! How do you do?')
end.

Good luck! :)

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...