2008/10/22

Дараах нөхцөлт давталт

do
{
үйлдлүүд;
}
while(Нөхцөл);

Бидний авах жишээ гараас хоёр тоог авч, тэдгээрийн ноогдвор, үлдэгдэлийг гаргасаны дараа ахин энэ үйлдлүүдийг давтах эсэх талаар нөхцөл шалгана. Гараас 1 оруулбал ахин давтана, 0-ийг оруулбал давталт зогсоно.

#include
main()

{
int x;
int m,n;

do

{

printf("huvaagdagch:\n"); scanf("%d",&m);

printf("huvaagch:"); scanf("%d",&n);

printf("noogdvor: %d \n",(m/n));

printf("uldegdel: %d \n",(m%n));

printf("urgeljluuleh uu ? (Tiim bol 1/ ugui bol 0)\n"); scanf("%d",&x);

}

while (x!=0);

}


Жишээ нь:
huvaagdagch: 16
huvaagch: 5
noogdvor: 3
uldegdel: 1
urgeljluuleh uu ? (Tiim bol 1/ ugui bol 0) 1
huvaagdagch: 97
huvaagch: 20
noogdvor: 4
uldegdel: 17
urgeljluuleh uu ? (Tiim bol 1/ ugui bol 0) 0

4 comments:

  1. You should be a part of a contest for one of the highest quality sites on the net. I’m going to highly recommend this blog! The training and certification courses to get trained on microtek training. I got really cleared my doubts by reading your informative information.

    Well i also founded something interesting over here in microtek training solutions

    ReplyDelete
  2. WhatsApp Plus v19.32 Crack application that is messaging for Android system only. This application works on your phones that are different. Whatsapp Crack Version

    ReplyDelete
  3. Looks at to having your own sister. A connection and someone with whom you'll share your young life memories and educational encounters. Happy Sister Day Wishes

    ReplyDelete

Миний бичсэн бичлэг танд өчүүхэн ч болтугай хэрэг болсон бол сэтгэгдлээ бичиж үлдээхийг хүсье. Баярлалаа :)