User-submitted CPP Projects

113
2622 reads
ram20

Comments

Comments are parts of the source code disregarded by the compiler. They simply do nothing.


Run It Now!
106
3834 reads
ram19

All in just one line and this would have had exactly the same meaning as the previous code.

In C++, the separation between statements is specified with an ending semicolon (;) at the end of each on


Run It Now!
123
2145 reads
oddsum

#include
#include

using namespace std;

int main(int argc, char* argv[])
{
long max = 0;
long sum = 0;

cout<<"Enter Maximum No:";
cin>>max;


Run It Now!
110
2546 reads
ram4

#include

class Animal
{
public:
Animal():itsAge(1) { std::cout << "Animal constructor...\n"; }
virtual ~Animal() { std::cout << "Animal destructor...\n"; }
Animal


Run It Now!
113
2550 reads
ram3

DiamondOfNumbers


Run It Now!
121
2896 reads
Ram2

#include
using namespace std;
#include
#include

int main()
{
float a,b,c,d,e,f,g,h,i,j,n,sum,sub,mul,div;
cout<<"enter a value for a = ";
cin>>a;
cout<<"enter a


Run It Now!
122
2852 reads
Ram1

// Tic-Tac-Toe
// Plays the game of tic-tac-toe against a human opponent
#include
#include
#include
#include
using namespace std;
// global constants
c


Run It Now!
52
2588 reads
78
2429 reads
guess_the_number(1.0)
try to guess a number within 1 to 100 in three attempts which computer remembers
guess_the_number(1.0)

Enhancement Trail:  

guess_the_number(1.0)    guess_the_number





Run It Now!
69
2921 reads
guess_the_number(1.0)
try to guess a number within 1 to 100 in three attempts which computer remembers
guess_the_number(1.0)

Enhancement Trail:  

guess_the_number(1.0)    guess_the_number





Run It Now!