Answer to the Challenge in How to program in C# nr. 4

Updated on May 15, 2017 in General
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
4 on September 14, 2014

So here is my answer to the challenge I gave you in How to program in C# nr. 4. I’m posting it here so those of you who couldn’t get it to work can see one possible way of doing it. Also, I’m planning to expand on this code in video nr. 5 so you can just copy/paste from here when the video comes out (currently working on it). Enjoy 🙂


using System;
namespace FirstConsoleProject

{

class MainClass

{

public static void Main (string[] args) // this is a method called "Main". It is called when the program starts.

{

int num01 = 16;

int num02 = 4;
Console.WriteLine ("What is " + num01 + " times " + num02 + "?");
int answer = Convert.ToInt32 (Console.ReadLine ());
if (answer == num01 * num02) {

Console.WriteLine ("Well done! Your answer is correct.");

} else {

Console.WriteLine ("Are you even trying?");

}
Console.ReadKey();

}

}

}

  • Liked by
  • Ajbaluch
  • Skyscope
  • Gabester
  • Wolf_MCS
  • Spangui
  • +2
Reply
2 on May 13, 2015

Can i somehow make the numbers random ?

on May 14, 2015
on May 17, 2015

I googled it then try to make my program. And then I go to the next tutorial and saw he used that in the tutorial 😀 
But still thx for trying to help me :))

Show more replies
  • Liked by
Reply
Cancel
0 on May 15, 2017

Hello, guys, I am a 3D game Artist I have no knowledge of game development and I want to be an indie game developer so this course will help me? My target is to learn C# Basic and then move to Unity development what you say guys I am on right track or what?

  • Liked by
Reply
Cancel