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

פורסם

tch.png.9a6c155a5bfdb3978142d41917b68980.png

 

עריכה: הסתדרתי עם השלב הראשון והגעתי לפה:

עכשיו השאלה איך אני יכול לסכום את כל הספרות האלה לאחר שכל המספרים בהתחלה נקלטו?

תודה!

 

#include<stdio.h>

void main()
{
	//Variables
	int mis, i=1, digit, average;
	int sum_ahadot, sum_asarot, sum_meot, sum_alafim;
	printf("Enter 10 numbers with 4 digits each:\n");
	
	//Input check
	while (i <= 3) {
		scanf("%d",&mis);
		if (mis >= 1000 && mis <= 9999) {
			printf("%d) the number is: %d\n", i, mis);
			i++;
		}
		else{
			printf("Wrong number! Enter a number with 4 digits:\n");
			i--;
		}
	}

נערך על-ידי mecharbsc

פורסם

תשתמש בmod10 כדי לפרק את המספרים.

פורסם

האופרטור a%10 נותן את האחדות של a, תחלק את a ב10 ואז אותו האופרטור יתן לך את ספרת העשרות, תחלק שוב ב10 האופרטור יתן את המאות...

נערך על-ידי Buck

ארכיון

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

דיונים חדשים

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.