D Programming – Input

Good Day, I was to talking to little kid this morning and he was asking me what color is the best. Every time I said a color he always answered “Really? (color)?”
What’s your favorite color? Yellow
Really? Yello?

haha, his expression made his annoying answer funny.

I adapated that kid to my program here showing basic input of string in D language.

Here is my annoying kid asking for colors program:

import std.stdio;
import std.string;

int main(){
	string input = "";
	write("What is your favorite color? ");
	input = strip(stdin.readln());
	writeln("Really? ", input, "?");
	return 0;

Here is the output:



I hope you like this post. Don’t forget to leave a comment.

Thank you very much.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s