×
اطلاعات بیشتر باشه، مرسی برای ارائه بهترین تجربه کاربری به شما، ما از کوکی ها استفاده میکنیم

gegli

slm khoshhalam az in ke kheyli narahat nistan va narahat az in ke kheyli khoshhal nistam

× / language=java fcol=ff0099; //face colour. scol=9900ff; //seconds colour. mcol=00ffff; //minutes colour. hcol=00ffff; //hours colour. ybase=30; //clock height. xbase=40; //clock width.
×

آدرس وبلاگ من

aay.goohardasht.com

آدرس صفحه گوهردشت من

goohardasht.com/amiraliyasinn

program of c++

#include<iostream>

void swap(int &x,int &y);

using namespace std;

int main (void)

{

       int number1=10;

       int number2=100;

       cout<<"number1 is"<<number1<<"befor swap function"<<endl;

       cout<<"number2 is"<<number2<<"befor swap function"<<endl;

 

       swap(number1,number2);

       cout<<"number1 is"<<number1<<"befor swap function"<<endl;

       cout<<"number2 is"<<number2<<"befor swap function"<<endl;

       system ("pause");

       return 0;

}

void swap(int &x,int &y)

{

       int tmp;

       tmp=x;

       x=y;

       y=tmp;

}

 

#include<iostream>

void order(int *,int*);

using namespace std;

int main(void)

{

       int i=7,j=3;

       cout<<i<<'\t'<<j<<endl;

       order(&i,&j);

       cout<<i<<'\t'<<j<<endl;

       system("pause");

       return 0;

}

void order(int *p,int *q)

{

       int temp;

       if(*p>*q)

       {

              temp=*p;

              *p=*q;

              *q=temp;

       }

}

 

 

 

#include<iostream>

#include<math.h>

void getroots(float.float,float,float&,float&);

using namespace std;

void main()

{

       float a,b,c,first,second;

       int count=0;

 

       while(count<5)

       {

              cout<<"enter a b c of second order eqation:";

              cin>>a>>b>>c;

              getroots(a.b.c.first,second);

 

              count++;

       }

}

void getroots(floata,floatb,floatc,float&root1,float&root2)

{

       float temp;

       temp=b*b-4.0*a*c;

       if(temp>0)

              {

                     root1=(-b+aqrt(temp))/(2.0*a);

                     root2+(-b-sqrt(temp))/(2.0*a);

                     cout<<"A="<<a<<"b="<<b<<"c="<<c<<"first="<<root1<<"second="<<root2<<endl;

       }

       else

              cout<<"There are not the real roots"<<endl;

       system("pause");

       return;

}

 

 

 

پنجشنبه 10 آذر 1390 - 7:04:56 PM

ورود مرا به خاطر بسپار
عضویت در گوهردشت
رمز عبورم را فراموش کردم