Kompyuter injiniringi fakulteti swd003 guruhining talabasi
Download 0.49 Mb.
|
3-Mustaqil ish
Muhammad al-Xorazmiy nomidagi Toshkent axborot texnologiyalari universiteti Kompyuter injiniringi fakulteti SWD003 guruhining talabasi Jumabayev Samandarning 3-mustaqil ishi #include #include using namespace std; int factorial(int a) { int s=1; for(int i=1;i<=a;i++) s*=i; return s; } int factorial_2(int b) { int s=1; for(int i=1;i<=b;i++) s*=i; return s; } int factorial_3(int c) { int s=1; for(int i=1;i<=c;i++) s*=i; return s; } int main() { int a,b, c; cout<<"a="; cin>>a; cout<<"b="; cin>>b; cout<<"c="; cin>>c; cout<< factorial(a)< } #include #include using namespace std; bool palindrom(int a) { int r,temp,s=0; temp=a; while(a>0) { r=a%10; s=s*10+r; a=a/10; } if(temp==s) return true; else return false; } int main() { int a; cout<<"a=";cin>>a; bool res; res=palindrom(a) ; if(res) cout<<"Bu palindrom son"; else cout<<"Bu palindrom son emas"; return 0; } Download 0.49 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling