עבור לתוכן
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.

צריך עזרה ב-C

Featured Replies

פורסם

#include <stdio.h>
int main(void)

int AddToNum(int num);
{

int num;
int result;

printf("Please Enter A Number : ");
scanf("%d" , &num);
result = AddToNum(num);
printf("The Total Amount is : \n", result);
}


int AddToNum(int num)
}
int i;
int sum;
sum = 0;
for (i = 0; i <= num;i = i + 1)
sum = sum + 1;
return(sum);

fflush(stdin);
getchar();
return 0;

}

זה פונקציה שקולטת מספר שלם ומחזירה את סכום המספרים מ-1 ועד לאותו מספר.

אני מקבל שגיאה ולא יודע מה הבעיה.

פורסם

פשוט יש יותר מדי, אז לפעמים הקומפיילר משתגע.

לא הגדרת את התוכן של פונקציה main.

הגדרת 2 פונקציות שונות עם אותו שם.

יש לך סוגריים מסולסלים לא בסדר הנכון.

נסה לבנות את התוכנית בלי פונקציות בכלל (רק עם main) ואז לשנות אותה.

פורסם
  • מחבר

אוקיי תודה ועוד משהו.

התוכנה הזאת שאני מקמפל הוא אותר לי שהוא לא מזהה את abs למרות שרשמתי למעלה #include <math.h>

#include <stdio.h>
#include <math.h>
int main(void)
{
int i;
printf("Please enter a number: ");
scanf("%d", &i);
printf("Absolute value of %d is %d\n", i, abs(i));
fflush(stdin);
getchar();
return 0;
}

פורסם
  • מחבר

אז כנראה המדריך הזה לא ממש נכון\מעודכן.

תודה רבה.

ארכיון

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

דיונים חדשים

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.