کامپیوتر

بایگانی
آخرین مطالب

۳۶ مطلب در بهمن ۱۳۹۶ ثبت شده است

  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

#include "cmath"

using namespace std;

//alidoran

int main() {

for (float n=0; n < 2; n += 0.2) {

for (float b=0; b < 2; b += 0.2) {

cout << pow(b, n)<<"\t"<<exp(n*log(b))<<endl;

}

}

system("pause");

return 0;

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

#include "cmath"

using namespace std;

//alidoran

int main()

{

for (float x = 0; x < 2; x += 0.2) {

cout <<"cos^2("<<x<<")+sin^2("<<x<<")="<< pow(cos(x), 2)+ pow(sin(x) , 2)<< endl;

}

system("pause");

return 0;

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

#include "cmath"

using namespace std;

//alidoran

int main()

{

for (float x = 0; x < 2; x += 0.2) {

cout <<"cos 2*"<<x<<" = "<<cos(2 * x) << "\t" <<"2*(cos^2)("<<x<<")-1= "<<2*pow(cos (x),2)-1 <<endl;

}

system("pause");

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp 


#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main() {

       int x, y , z=1;

       cout << "please enter two number"<<endl;

       cin >> x >>y;

       while (z > 0) {

              z = x % y;

              x = y;

              y = z;

       }

       cout << "your answer is : " << x << endl;

       system("pause");

       return 0;

       }

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main() {

       int x, y=0;

       cout << "please input your number" << endl;

       cin >> x;

       while ((y*y) <= x)

              y++;

       cout <<"answer is : "<< y - 1<<endl;

       system("pause");

       return 0;

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main() {

int x,y=0;

cout << "please enter your number : ";

cin >> x;

while (x > 0) {

y += (x % 10);

x /= 10;

y *= 10;

}

cout <<"mirror of your number is : "<< y/10<<endl;

system("pause");

return 0;

}

  • علی دوران
  • ۰
  • ۰


#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main() {

       int x,y,z=0,t=0;

       cout << "please input two number"<<endl;

       cin >> x>>y;

       cout << "calculate "<<x<<"/"<<y<<endl;

       while (t < (x-y)){

              z++;

              t += y;

       }

       cout <<"divisor is : "<< z << endl <<"quotient is : "<< x - t << endl;

       system("pause");

       return 0;

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main() {

int x, s=0;

cout << "please enter your nember";

cin >> x;

do {

s += (x*x);

x -= 1;

}

while (x > 0);

cout << s;

system("pause"); return 0;

}

  • علی دوران
  • ۰
  • ۰

فایل متنی

فایل cpp

#include "stdafx.h"

#include "iostream";

using namespace std;

//alidoran

int main()

{

       int x, s=0;

       cout << "please enter your number : ";

       cin >> x;

       for (; x > 0; x--) s += (x*x) ;

       cout <<"your number plus is : "<< s<<endl;

       system("pause");

       return 0;

}

  • علی دوران
  • ۰
  • ۰
فایل متنی

#include "stdafx.h"

#include "iostream"

using namespace std;

//alidoran

int main()

{

       int x,s=0;

       cout << "input your number";

       cin >> x;

       while (x > 0)

       {

              s += (x * x);

              x -= 1;

       }

       cout << s;

       system("pause");

    return 0;

}

  • علی دوران