D program code

Vincent spawn_rock2000 at yahoo.com
Wed Nov 13 06:36:20 PST 2013


import std.stdio,std.cstream;

void main(string[] args)
{
	int first;
	int second;
	
	write ("First Number     : ");
	readf (" %s", &first);
	
	write ("Second Number    : ");
	readf (" %s", &second);
	
	int result = first + second;
		
	writeln("Result: ", result);
	din.getc();
}

_________________________________

Problem: When I run this code why it is automatically exit when 
it shows the
          result. It allows me to input first numbers and second 
number but when
          it shows the result it will totally exit and I can't see 
the output.

I use D-IDE as my editor and dmd2 as my compiler.


More information about the Digitalmars-d mailing list