![]() |
| ||
| May I ask you a question on Delphi? May I ask you a question on Delphi? The following is my question: Write a program that asks for two numbers from the user. Add these numbers together and store them. Then output to the screen the equation with the correct answer. Eg please enter a number 28 please enter another number 3 thank you 28 + 3 = 31 But I do in this way: program sumof2numbers; Could you tell me how can I show: 28 + 3 = 31 ?? Cheers, |
| ||
| Re: May I ask you a question on Delphi? the answer is very simple... Program sumof2numbers; |
| ||
| Re: May I ask you a question on Delphi? or more simple Program sumof2numbers; |
| ||
| Re: May I ask you a question on Delphi? Dear Sir, Thank you for your help. I have got a serious problem on some of the basic skill on programming. Cheers, |
| ||
| Re: May I ask you a question on Delphi? Would you tell me something about the use of 'delimiter' and 'comma' and 'semi-colon'? Just like the following line: WriteLn(number1,'+',number2,'=',total); |
| ||
| Re: May I ask you a question on Delphi? In the pascal lang almost every commands ended with semicolon ; except Begin or the end of the main program End.,it is ended with dot. if you want to know a contetnt of a variable then you have to reference it by its name without apostrophe. Look at this example: Program commas_and_delimiters; Var digit:Char; Begin digit:='#'; WriteLn(digit); {this line writes digit's contents,like #} {if you want to write to the screen then do it by apostrophe} WriteLn('Press enter to quit...'); {if you want to write to the screen and write the contents of digit, detach them with comma} WriteLn('The first character is ',digit); {if you have another thought too,then detach with comma and put the thoughts after that,of course between apostrophe} WriteLn('The first character is ',digit,'.Guess it please'); {if you want to write to the screen four times the contents of the reserved area by the compiler,called digit ,call its name detach them with comma} WriteLn(digit,digit,digit,digit); End.{end of main program} I hope that you understood now :D |
| ||
| Re: May I ask you a question on Delphi? Quote:
Dear Sir, Thank you for your detailed expression. Cheers, |
| All times are GMT -4. The time now is 6:55 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC