c++ programs

These programs covers all c++ concepts. There is one simple program for each topic.

1.simple cpp program without using class.

#include”iostream.h”
#include”conio.h”
void main()
{
int a,b,c;
cout<<”enter two numbers to multiply\n”;
cin>>a>>b;
c=a*b;
cout<<”the multiplication of two numbers is\t”<<c;
getch();
}

2.simple cpp program using class

#include”iostream.h”
#include”conio.h”
class A
{
int a,b;
public:
void read()
{
cout<<”enter two numbers :”;
cin>>a>>b;
}
void print();
};
void A :: print()
{
cout<<”\n The values of a and b are :”<<a<<endl<<b;
}
void main()
{
A obj;
obj.read();
obj.print();
getch();
}

3.Tribonacci series of . . . → Read More: c++ programs