Dastur kodi:
#include
#include
using namespace std;
int main()
{
double M, t;
cout<<"KG ni kiriting: "; cin>>M;
cout<
return 0;
}
Natija:
2-misol
Butun son berilgan. Agar, berilgan son musbat bo'lsa, 1 ga oshiring, aks holda 2
ga kamaytiring. Hosil bo'lgan sonni ekranga chiqaruvchi programma tuzilsin.
Dastur kodi:
#include
#include
using namespace std;
int main()
{
double n;
cout<<"n ni kiriting: "; cin>>n;
if(n >= 0) {
cout<<"Natija = "<
} else {
cout<<"Natija = "<
}
return 0;
}
Natija:
3-misol
Dastur kodi:
#include
#include
using namespace std;
int main()
{
int a,b,i;
cout<<"a ni kiriting: "; cin>>a;
cout<<"b ni kiriting: "; cin>>b;
if(a < b) {
for(i = a; i<=b; i++) {
cout<
}
cout<
}
return 0;
}
Natija:
Do'stlaringiz bilan baham: |