1. C++ tili 1980-jıllar basında Bjarne Stroustrup tárepinen c ge tiykarlanǵan halda dúzildi
Download 53.62 Kb.
|
1 2
Bog'liqалгоритм
- Bu sahifa navigatsiya:
- include using namespace std; int main(){ int a,b; cout cin >> a; cout
Begin 19
#include #include using namespace std; int main(){ float a,b,p,s; cout<<"koordinatalarin kiritin:"; cin >>a>>b; p=2*(a+b); s=a*b; cout<<"perimetr:" < cout<<"maydan:" << s; return 0; Bool 5 #include using namespace std; int main() { int a,b; cout<<"a sanin kiritin:"; cin >>a; cout<<"b sanin kiritin:"; cin >>b; bool i=a>=0 || b<-2; cout < cout< return 0; Integer 12 #include using namespace std; int main() { int abc, cba; cout<<"ush xanali san"; cin >>abc; cout<< endl; cba= (abc%10)*100+(abc%100/10); cout<<"teris tartipte jaziwdan payda bolgan san"; return 0; } IF 28 #include using namespace std; int main(){ int year; cout<<"yil raqamini kiritin:"; cin >> year; int days = (year%400 == 0|| year%4 ==0 && year%100 !=0)? 366:365; cout<<"bu yilgi kunlar soni:"; return 0; } Case1
#include using namespace std; int main(){ int k; cout<< "1-7 ge shekem bolǵan pútin sanlar kiritin:"; cin >> k; switch (k) { case 1: cout << "dushanba\n"; break; case 2: cout << "seshanba\n"; break; case 3: cout << "chorshanba\n"; break; case 4: cout << "payshanba\n"; break; case 5: cout << "juma\n"; break; case 6: cout << "shanba\n"; break; case 7: cout << "yakshanba\n"; break; cout<< "haftaning bunday kuni yoq.\n"; } return 0; For9
using namespace std; int main(){ int a,b; cout<< "a:"; cin >> a; cout<< "b:"; cin >> b; int i, natiyja=0; for (i=a; i<=b; ++i) natiyja +=i*i; cout<< "natiyja:" < While2 #include using namespace std; int main(){ int a,b; cout<< "A:"; cin >> a; cout<< "B:"; cin >> b; int kesindi=a; int san=0; while (b>=0){ kesindi =b; ++san; } cout<< san; } Array25 Download 53.62 Kb. Do'stlaringiz bilan baham: |
1 2
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling