ToMotion AI logo
Menu
Back to gallery

Public AI explainer video

Do-While Loop in C: Online GDB

अगर code को condition check से पहले एक बार चलाना हो, तो C में क्या use करेंगे? Phone या app का input prompt याद कीजिए। Prompt पहले खुलता है, आप value...

Prompt

Source idea used to generate this video.

Use following content & Explain it in hindi but in romanhindi, dont use hindi hard words, use English words for English Terms. Explain in Tutor Style, Also dont write Hindi words while explaining, only English letters can be used Control Flow Structures with do while Loops programing in C using online GDB step by step

Narration

Narration used to create this video.

Video narration

अगर code को condition check से पहले एक बार चलाना हो, तो C में क्या use करेंगे? Phone या app का input prompt याद कीजिए। Prompt पहले खुलता है, आप value देते हैं, फिर app तय करता है कि दोबारा पूछना है या नहीं। यही idea यहाँ काम करता है। Control flow यानी program के steps किस order में चलेंगे। Loop एक काम repeat कराता है। do-while में पहले body चलती है, फिर condition check होती है। इसलिए body कम से कम एक बार जरूर चलती है। Online GDB में लिखिए: int number; do { printf("Number डालिए: "); scanf("%d", &number); } while (number != 0); अब Run दबाइए और console में पहले 5, फिर 0 दीजिए। 5 पर condition true है, इसलिए prompt फिर आएगा। 0 पर condition false है, इसलिए अगली repeat नहीं होगी। while के बाद semicolon जरूरी है। तो जवाब है: do-while। Input prompt की तरह, पहले code चलेगा, फिर condition check होगी—कम से कम एक बार।