עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

do while שאלה בשפת C

Featured Replies

פורסם

בוקר טוב,

מישו יוכל להגיד לי איך לשנות את הקוד הבא:

הבעיה בו שאני מבקש קלט ראשוני תקין ז"א מס חיובי ושלם הוא מחכה לעוד הזנה ורק אז נותן את התשובה המבוקשת

ורק אם אני אכניס קלט שגוי ראשוני הוא יכנס ללולאה ויבקש קלט תקין ורק אח"כ קלט תקין יראה תשובה נכונה

#include <stdio.h>

int i,n,check=0; //משתנים גלובליים

void input();
void loop();

int main() //הפונקציה הראשית
{
input();

do
{
if (scanf("%d",&n)<1 || (n<0))
{
check=1;
printf("Error Enter Only Numbers And Above 0\n");
}
else
{
printf("The Uneven Numbers Until %d Are:\n",n);
loop();
check=0;

}
fflush(stdin);

}while(check==1);


}

void input() //פונקציית קלט
{

printf("Enter Number\n");
scanf("%d",&n);
}

void loop() // פונקציית לולאה
{


for(i=1; i<n; i+=2)
{
printf("%d\n",i);

}


}

[br]פורסם בתאריך: 28.11.2008 בשעה 08:22:31


טוב אל תתאמצו פתרתי לבד....

תודה בכל מקרה.

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.