// constructor program to add two number's
// program written by SuNiL kUmAr
#include<iostream.h>
#include<conio.h>
class constructor
{
private:
int a,b;
public:
constructor(int m,int n);
int sum();
};
constructor::constructor(int m,int n)
{
a=m;
b=n;
}
int constructor::sum()
{
int s;
s=a+b;
return (s);
}
int main()
{
int x,y;
clrscr();
cout<<"enter two number's to add \n";
cin>>x>>y;
class constructor k (x,y);
cout<<"sum of two number's is = "<<k.sum();
getch();
return (0);
}
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
mano ni anda yarrr
b + b + b + c + c + c + c = 3b + 4c
c + c + c + c + c = 5 * c.
Not defined by the language, it depends on the OS/platform/context. Usually, it is the terminal(emulation) or DOS-shell or console in which the program runs.
Yes.
True - A C++ constructor cannot return a value.
By learning how to program on C+.
An implicit constructor call will always call the default constructor, whereas explicit constructor calls allow to chose the best constructor and passing of arguments into the constructor.
You don't write an algorithm for a C++ program, unless you are documenting the C++ program after-the-fact. The normal procedure is to write the algorithm first, in a language independent fashion, and then translate that stated algorithm into C++ code, or into whatever language you wish.
how to write a program that counts automorphic number from 1 to 999
Divide it by 1000.
No.
Don't write, it is already written, google for 'cpp'.
there is no solution of this problem...........that's it..........
Its limited only by available memory.
Write your program and if you are having a problem post it here with a description of the problem you are having. What you are asking is for someone to do your homework for you.