#include<iostream.h>

#include<conio.h>

main(){

                int a,b,c;

                cout<<”Enter 2 numbers:”;

                cin>>a>>b;

                c=a+b;

                cout<<”Result:”<<c;

                getch();

}


 البته می توانیم در این برنامه از متغیر c استفاده نکنیم و به جای آن بنویسیم:

#include<iostream.h>

#include<conio.h>

main(){

                int a,b;

                cout<<”Enter 2 numbers:”;

                cin>>a>>b;

                cout<<”Result:”<<a+b;

                getch();

}