DEV Community

asliddin0737
asliddin0737

Posted on

Qism va qoldiqni topish uchun C++ dasturi tuzing

Salom dasturchi. Bugungi dars paytida ustoz bizaga problem berdilar.
C++ da qism va qoldiqni topadigan dastur chop etish kerak.
1 Kutubxona nomini kiritamiz
2 Using namespace std ni yozamiz
3 int main() qilib
4 Figurniy qavs ochamiz
5 Data typega 2 ta son yozamiz
6 1- sonni cout qilib, undan input chiqaramiz
7 2 - sonni cout qqilib , undan input chiqaramiz
8 cout qilib "Natija " deb yozib, son 1/son2
9 cout qilib "Natija " deb yozib, son 1%son2
10 Kod muafaqiyatli tugadi dib, faqat dasturlash tlida yozamiz
11 Figurniy qavs bilan yopamiz

include

using namespace std;

int main()
{

int son1;
int son2;

cout << "son1=";
cin >> son1;

cout << "son2=";
cin >> son2;

cout << "Natija: " <<  son1 / son2 << endl;
cout << "Natija: " << son1 % son2 << endl;

return 0;
Enter fullscreen mode Exit fullscreen mode

}

Top comments (0)