954,500 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

C++ Coding :: First Ever

Everybody, post your very first C++ code up here if you still have it, heres mines with help from the book I am reading and Narue for the help of keeping the window open, thanks pal.

//
// Program to convert temperature from Celsius degree
// units into Fahrenheit degree units:
// Fahrenheit = Celsius  * (212 - 32)/100 + 12
//

#include <iostream>
 
using namespace std;
 
int main()
{
  // enter the temperature in Celsius
  int celsius;
  cout << "Enter the temperature in Celsius: ";
  cin >> celsius;
 
  // calculate conversion factor for Celsius to Fahrenheit
  int factor;
  factor = 212 - 32;
 
  // use conversion factor to convert Celsius into Fahrenheit values
  int fahrenheit;
  fahrenheit = factor * celsius/100 + 32;
 
  // output the results
  cout << "Fahrenheit value is: " << fahrenheit << endl;
 
  // remove extraneous characters from the input stream
  char ch;
  while ( cin.get ( ch ) && ch != '\n' )
	;
 
  // pause until the user hits Enter
  cout << "Press Enter to continue...";
  cin.get();
}
Young Teck 06
Posting Pro in Training
440 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 

[PHP]#include
using namespace std;

int main()
{
cout<<"Hellp World"<

kakilang
Newbie Poster
22 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Great, thanks for putting it in PHP Coding form.

Young Teck 06
Posting Pro in Training
440 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 

[PHP]#include using namespace std;

int main() { cout<<"Hellp World"<

Freudian slip, do you want the world to hellp you, or do you think the world needs hellp? Anyway, cute!

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

lol :D nice

Young Teck 06
Posting Pro in Training
440 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 

Opps

#Include <iostream.h>
int main ()
{
cout << "Hello world!";
cin.get ();
return 0;
}
N3wbi3C0d3r
Junior Poster in Training
67 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

Hello world is a popular first script 'eh

Young Teck 06
Posting Pro in Training
440 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 

Yep partner, "Hello World!" has been around. I remember writing it on a DEC PDP-11 the size of a refrigerator. Then it was C, simple and fast.
[php]
main()
{
printf("Hello World!");
}
[/php]

vegaseat
DaniWeb's Hypocrite
Moderator
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
 

well, at least its something written ;)

Young Teck 06
Posting Pro in Training
440 posts since Sep 2004
Reputation Points: 12
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You