Jump to content

Something like this, but this won't work in C# 

int main(){    while(1){        printf("Hello, what is your name?");         string name = getline();         printf("How old are you %s?\n", name);         int age = getint();         printf("In what month were you born?\n");         int month = 0;         while(month <1 || month >12) {            month = getint();             if(month < 1 || month > 12)                printf("That month is not valid)         }        age = 2015-age;         printf("So you were born in %d\n", age);         return 0; }

PSU Tier List | CoC

Gaming Build | FreeNAS Server

Spoiler

i5-4690k || Seidon 240m || GTX780 ACX || MSI Z97s SLI Plus || 8GB 2400mhz || 250GB 840 Evo || 1TB WD Blue || H440 (Black/Blue) || Windows 10 Pro || Dell P2414H & BenQ XL2411Z || Ducky Shine Mini || Logitech G502 Proteus Core

Spoiler

FreeNAS 9.3 - Stable || Xeon E3 1230v2 || Supermicro X9SCM-F || 32GB Crucial ECC DDR3 || 3x4TB WD Red (JBOD) || SYBA SI-PEX40064 sata controller || Corsair CX500m || NZXT Source 210.

Link to comment
https://linustechtips.com/topic/457610-need-help-with-c/#findComment-6140967
Share on other sites

Link to post
Share on other sites


namespace derpaderp talks back

{

class Program

{

static void Main(string[] args)

{

// Variable for the value "name"

string name;

// Console asks for a name

Console.WriteLine("Hello! I am derpaderp. What is your name?");

// Holds the value

name = Console.ReadLine();

// Displays the response

Console.WriteLine("Hi, {0}! I'm glad your name isn't as dumb as mine!", name);

}

}

}

Link to comment
https://linustechtips.com/topic/457610-need-help-with-c/#findComment-6140997
Share on other sites

Link to post
Share on other sites

That's because it's not there. For some reason people like to suggest codecademy for everything, even when it doesn't actually teach what's being asked about.

 

It fills me full of such rage...  :blink:

The single biggest problem in communication is the illusion that it has taken place.

Link to comment
https://linustechtips.com/topic/457610-need-help-with-c/#findComment-6144757
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×