Professional Documents
Culture Documents
character add hbe ta ta r number didte hbe example: { char name [13] = “anisur Rahman ” ;
#include <iostream>
#include <conio.h>
using namespace std ;
int main ()
{
}
2.{
int num1,num2,sum;
cout<< "enter two number";
cin>> num1>>num2; for user input two value
sum = num1 +num2;
cout<< sum;
getch () ;
3#
int num1,num2;
num1=20;
num2=30;
int sum = num1+num2;
cout<<"sum is = "<<sum<<endl;
4.
{
float num1,num2; // float use kora hoyeche point number show koranr jnnno //
cout<<"enter two number = "<<endl;
cin>>num1>>num2;
cout<<showpoint; // point show korar jnno//
cout<<fixed; //
cout<< setprecision(3); /* joto number likha hbe output e result toto number e asbe point er ahge
and popint er por soho but ahge fixed use
korle than joto sonkha likha hbe toto sonkha point er por dekhabe*/
cout<<noshowpoint;
float sub = num1 - num2;
cout<<setw(25)<<"substraction is = "<<sub<<endl;
double div = (float)num1 / num2; // DOHOMIC er por ER NUMBER SHOW KORANOR JNNO 'INT' ER
JAYGAY 'DOUBLE'USE AND JEI KONO EKTA KE FLOT SHOW KRTE HBE//
cout<<setw(25)<<"division is = "<<div<<endl;
getch () ;
}
5. for find out triangle area
{
double base,height,area;
cout<<"enter base";
cin>>base;
cout<<"enter height";
cin>>height;
getch () ;
6. area of circle
{
double pi,radious,area;
pi = 3.1416;
cout<<"enter radious";
cin>>radious;
area=pi*radious*radious;
cout<<"area of circle is " << area;
getch () ;
7.celcious to farhenhite
{
double farn,cels;
cout<< "enter celcious";
cin>>cels;
farn=1.8*cels+32; // for another jut put the right sue//
cout<<"Fahrenheite = "<<farn;
getch () ;
}
8. assignment operator
{
int x=3;
int y=2;
x+=y; //x=x+y//
cout<<x<<endl;
x-=y; //x=x-y//
cout<<x;
getch () ;
9. unary operator
{
int x=6;
int result = -x; // minus value output hisebe dekkhanor jnno//
cout<<result<<endl;
int x1=3;
--x1; // decriment: ahge bosano hoyeche 2 ta -- so output er ahge -1 hbe //
cout<<x1<<endl;
getch ();
c = a^b; //exor//
cout<<c<<endl;
getch () ;
}
11. apecial operator
{
int a;
float f;
double d;
char ch ;
char name [20];
getch () ;
12.if statement
{
int num;
cout<<"enter any integer number :";
cin>>num;
if(num>0)
cout<<"positive"<<endl;
if(num<0)
cout<<"negative"<<endl;
if(num==0)
cout<<"zero"<<endl;
getch () ;
13.if else
{
int num;
cout<<"enter any integer number :";
cin>>num;
if(num>0){
cout<<"positive"<<endl;
}
else if(num<0) {
cout<<"negative"<<endl;
}
else // else e kono condition hbe na//
{
cout<<"zero"<<endl;
}
getch () ;