• Very first program.
    19 replies, posted
[img]http://fc03.deviantart.net/fs70/i/2013/193/9/0/successful_by_rudi52525-d6d5ahs.png[/img] This is my attempt to programing, i have programed a simple "Hello World" program. Fell free to share your opinion or criticism about it.
There's not much to critique about it except that it's a simple Hello World program :v: [editline]edit[/editline] That wasn't meant to sound discouraging though!
You can also do this instead of multiple "calls" to cout cout << "hello " << "world";
it's an uncommented hello world :V
Yeah.. Hello World program restyled. Haha.
[QUOTE=Dj-J3;41427337]You can also do this instead of multiple "calls" to cout cout << "hello " << "world";[/QUOTE] [img]http://fc04.deviantart.net/fs71/f/2013/193/f/b/success2_by_rudi52525-d6d5fdt.png[/img] Kinda efficient, thanks.
Don't forget about adding "<< endl" or "<< '\n' "
[QUOTE=Laserbeams;41427463]Don't forget about adding "<< endl" or "<< '\n' "[/QUOTE] Did that, thanks for the reminding.
Since it doesn't use anything from the Windows API (system() isn't [I]strictly[/I] part of that, I think) you can probably remove the inclusion of stdafx.h. Generally calls to system() directly are a bad idea (The commands are Windows-specific, if the string inside includes input from the user it can be a security vulnerability, and it's pretty heavy for the computer to fire up a whole shell and send a command when all you want to do is pause the program). When you want to pause a program until a user presses enter, you should use cin.get(), since it's platform-independent and you can supply your own message in place of Windows', or none at all. [CPP] #include <iostream> using namespace std; int main() { cout << "Press ENTER to continue."; cin.get(); return 0; }[/CPP]
My first program caused me to BSOD because I'm an idiot
Hello World Simulator 2014
Cool dude! Now write a game of [URL="http://en.wikipedia.org/wiki/Mastermind_(board_game)"]Mastermind[/URL]! It's not difficult, but it will open your mind a little and make things more interesting for you.
[QUOTE=dylanb5123;41430579]Hello World Simulator 2014[/QUOTE] You just gave me an idea.
Write a FizzBuzz program. Print all the numbers from 1-100. However, if a number is divisible by 3, print "Fizz." If it's divisible by 5, print "Buzz." Finally, if the number is divisible by both 5 and 3, print "FizzBuzz." It's a favorite programming challenge, and it should be a good test of your knowledge once you start working with loops and conditionals.
[QUOTE=Morgy;41434147]Write a FizzBuzz program. Print all the numbers from 1-100. However, if a number is divisible by 3, print "Fizz." If it's divisible by 5, print "Buzz." Finally, if the number is divisible by both 5 and 3, print "FizzBuzz." It's a favorite programming challenge, and it should be a good test of your knowledge once you start working with loops and conditionals.[/QUOTE] Things like this are the death of programming in my opinion - unless someone happens to just madly love programming straight off the bat, solving arbitrary problems is probably a waste of time My personal opinion would be to come up with something you find interesting and do that. It might be a little out of your reach, but you'll learn a lot trying to get there
[QUOTE=Icedshot;41434505]Things like this are the death of programming in my opinion - unless someone happens to just madly love programming straight off the bat, solving arbitrary problems is probably a waste of time My personal opinion would be to come up with something you find interesting and do that. It might be a little out of your reach, but you'll learn a lot trying to get there[/QUOTE] Maybe I am just weird. I love solving pointless puzzles for the brain game challenge of it.
[QUOTE=eirexe;41430797]You just gave me an idea.[/QUOTE] I am preparing my wallet.
I'd say something witty to indicate it's not much of an achievement, but I'm too afraid of any language even resembling C to touch it, so I really shouldn't be talking.
I've done something like this in java once. I was using Variable's values to mess around. This was the first and last thing I ever done in Java lol. [code] class apples{ public static void main(String args[]){ int Caca , Caco, Bobo; Caca = 19; Caco = 4; Bobo = 1; System.out.print("I want "); System.out.print(Caca); System.out.println(" movies"); System.out.println(""); System.out.println("Duh duh duh."); System.out.println(""); System.out.print("There is "); System.out.print(Caco); System.out.print(" Creepers"); System.out.println(" outside, so be careful man!"); System.out.println(""); System.out.print("I just want "); System.out.print(Bobo); System.out.print(" of theses"); } } [/code] Very easy to read through it. just a few messages using the number in the variable caca caco and bobo to complete the sentence
[QUOTE=pac0master;41454204][code] class apples{[/code][/QUOTE] Oh no
Sorry, you need to Log In to post a reply to this thread.