Essays.club - Получите бесплатные рефераты, курсовые работы и научные статьи
Поиск

Тест по "Программированию"

Автор:   •  Май 1, 2020  •  Тест  •  988 Слов (4 Страниц)  •  316 Просмотры

Страница 1 из 4

1. Герон формуласы арқылы үшбұрыш ауданын есептеңдер

# include "stdafx.h"

# include

# include

# include

void main ()

{

float a, b, c, P, S;

printf('%f,%f<%f",&a, &b, &c);

P=(a+b+c)/2.0;

S=sqrt(p*(p-a)*(p-b)*(p-c));

printf('ploscad' ravna %f", S);

getch();

}

2. Кубтың көлемін табу

#include

int main(){

double v,s,a;

cout<<"input a: "<

cin>>a;

v=a*a*a;

s=6*a*a;

cout<<"v= "<

char otvet;

double v,s,r;

do

{

wcout<

cin>>v;

r=pow(((3*v)/12.56), 1.0/3);

s=(r*2);

s=s*s;

s=s*6;

wcout<

wcout<

cin>>otvet;

}

while(otvet=='Y'||otvet=='y');

 

wcout<

 

return 0;

}

4. Екі санның қосындысын, айырымын, көбейтіндісін және бөліндісін есептеңдер.

#include "stdafx.h"                

#include

using namespace std;

int sum(int, int);

int sub(int, int);

int mul(int, int);

int divi(int, int);

int main()

{

    int a,b,c;

    char choice,t;

    bool quit =false;

    cout << "Enter a = ";

    cin >> a;

    cout << "Enter b = ";

    cin >> b;

    cout << sum(a,b);

    cout << sub(a,b);

    cout << mul(a,b);

    cout << divi(a,b);

    cout << "Z - summa, X - difference, C - multiplication, V - division, Q - quit" << endl;

    cin >> choice;

        while (choice != 'q' && quit == false)

        {

           

        if (choice = 'z')

        {

                  int sum(int a,int b);

               {

                   c=a+b;

                   cout << "a + b = " << c << endl;

               }

        }

        else if (choice = 'x')

        {

            int sub(int a,int b);

            {

                c=a-b;

                cout << "a - b = " << c << endl;

            }

        }

        else if (choice = 'c')

        {

            int mul(int a,int b);

            {

                c=a*b;

                cout << "a * b = " << c << endl;

            }

        }

        else if (choice = 'v')

        {

            int divi(int a,int b);

            {

                c=a/b;

                cout << "a / b = " << c << endl;

            }

        }

        else

            cout <<" Enter bad sybol";

        cout << "Do you want to quit?"<

        cin >> t;

        if (t =='y')

            quit =true;

    }

       

        system ("pause");

        return 0;

    }

...

Скачать:   txt (4.3 Kb)   pdf (77.3 Kb)   docx (11.8 Kb)  
Продолжить читать еще 3 страниц(ы) »
Доступно только на Essays.club