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

פורסם

זה התוכנית:

[code#include <stdio.h>

int main()

{

int bL; /* big letters counter*/

int sL; /*small letter counter*/

int i;

char letter;

sL = 0;

bL = 0;

for (i = 0; i < 3; i++) {

printf("enter a letter: \n");

scanf("%c", &letter);

if (letter >= 97 && letter <= 122)

sL = sL + 1;

if (letter >= 65 && letter <= 90)

bL = bL + 1; }

printf("the number of small letter %d \n the number of big letter %d", sL, bL);

return 0;]

תודה

פורסם


#include <stdio.h>


int main()
{
int bL; /* big letters counter*/
int sL; /*small letter counter*/
int i;
char letter;
sL = 0;
bL = 0;
for (i = 0; i < 3; i++) {
printf("enter a letter: \n");
scanf("%c", &letter);
if (letter >= 97 && letter <= 122)
sL = sL + 1;
if (letter >= 65 && letter <= 90)
bL = bL + 1;
}
printf("the number of small letter %d \n the number of big letter %d", sL, bL);
return 0;

יותר קריא.. איפה בדיוק אתה מסתבך ?

נערך על-ידי needacomp

פורסם
  • מחבר

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

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

פורסם

scanf עם c% קוראת תו בודד מהמשתמש. תו בודד אומר לא רק אותיות, אלא גם רווחים, ירידות שורה וכו'. אם אתה מכניס אות ואז אנטר אז בעצם הכנסת שני תווים - האות והאנטר (האנטר גם יכול להיות שני תווים בפני עצמו, אבל לא ניכנס לזה).

אם אתה רוצה שהתוכנה תדלג על רווחים ואנטרים, אתה צריך לשים רווח לפני ה-c%, דהיינו:

scanf(" %c", &letter);

ארכיון

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

דיונים חדשים

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.