Mustaqil ishi bajardi: Jamoliddinov Ibrohim Toshkent 2020 7-variant
Download 35.91 Kb.
|
Labaraturya 6
- Bu sahifa navigatsiya:
- MUSTAQIL ISHI
- DASTUR NATIJASI
O'ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI MUHAMMAD AL- XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI Informatika asoslari kafedrasi dasturlash II fanidan
Bajardi: Jamoliddinov Ibrohim Toshkent 2020
1-topshiriq Complex sinfidan foydalanib, ikkita kompleks sonlarni qo’shing. // sonli_sinflar.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include int _tmain(int argc, _TCHAR* argv[]) { using namespace std; complex <float> number1(-1,3); complex <float> number2 (1,-2); complex <float> yigindi; yigindi = number1 + number2; cout << "NATIJA: " << yigindi ; getchar(); getchar(); return 0; } NATIJA: 2-topshiriq Valarray sinfidan foydalanib, massivning barcha elementlari uchun inkrementini (prefiks (++i) va postfiks (i++) lar uchun) amalga oshiring. DASTUR KODI: // vallarray_class.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include #include #include #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { srand(time(NULL)); valarray <int> m(20),result; cout << "Joriy massiv elementlari:\n"; for(int i = 0; i < 20; i++){ m[i] = rand()%501; cout << m[i] << " "; } cout << endl << endl; cout << "........................................\n"; for(int i = 0; i < 20; i++) cout << ++m[i]<<" "; cout << endl; getchar(); getchar(); return 0; } DASTUR NATIJASI: Download 35.91 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling