how can i add 2 numbers using delphi console application
and also windows application , compare both program ,
reply immediatly
Answer Posted / faizulla khan
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
f1, f2: integer;
s: string;
begin
{ TODO -oUser -cConsole Main : Insert code here }
try;
f1:=0;
f2:=0;
write('Enter first integer: ');
readln(f1);
write('Enter second integer: ');
readln(f2);
writeLn('The numbers add up to '+inttostr(f1+f2));
writeLn('Press enter to quit');
except
on E : Exception do
writeln(E.Classname+' '+e.message);
end;
readln;
end.
| Is This Answer Correct ? | 18 Yes | 5 No |
Post New Answer View All Answers
What to have ready before you call Borland Developer Support?
Is there a programmatic way to add an alias to the IDAPI.CFG?
what are Safe Mode and VGA mode?
How do abstract classes differ from interfaces?
How to Connect via ODBC using Delphi or C++ Builder ?
How do I close a modal form? For that matter, what is the best way to close any form?
How to Use Stored Procedures ?
What to do if getting missing or corrupted file messages?
What is the function of inheritance in delphi?
How to use sets in code, such as adding to TDBGrid.Options, at run time?
How to add system menu items to a form ?
How tough is it to learn Delphi?
How to keep seconds from being included in the display when using TDateTimePicker?
How to Close popup menu in system tray application ?
How to prevent application?s main window from showing when application loads?