/*My second cpp programs
with comments in it :)*/
#include stdafx.h
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!"; //prints Hello World!
cout << "I am a c++ Program!"; //prints I am a c++ Program
cin.get();
return 0;
}
#include <iostream>
using namespace std;
int main()
{
cout << "hello world";
cout << "i am a C++ program" << endl; //added for your benefit.
system ("pause");
return 0;
}
Much appreciated.#include <iostream>
using namespace std;
int main()
{
cout << "hello world";
cout << "i am a C++ program" << endl; //added for your benefit.
system ("pause");
return 0;
}
c:\documents and settings\kelvin yeh\my documents\visual studio 2008\projects\hello world; comments\hello world; comments\hello world; comments.cpp(16) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
//This is practice for stringing and using variables. attempt #1 to make a basic add,sub.,multi.,divide calculator :)
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
{
int a;
int b;
int result = a + b;
cout << result << endl;
int result = a - b;
if b > a then int result = b - a;
cout << result << endl;
int result = a * b;
cout << result << endl;
float int result = a / b;
cout << result << endl;
system ("pause");
return 0;
}

//intern
#include "stdafx.h"
//extern
#include <iostream>
#include <conio>
static void pause()
{
cout << "Press any key to continue..." << endl;
_getch();
}
int main()
{
cout << "Aye yo, world, fuck you." << endl;
//pause
pause();
}