Skip to content

Βοήθεια Σε Άσκηση C

Featured Replies

Γράψτε ένα πρόγραμμα (με συνάρτηση void shift) το οποίο αφού εισάγει μια ακέραια τιμή έστω α, στη συνέχεια με την συνάρτηση shift να μηδενίζει την τιμή του α.

 

Μπορεί κάποιος να μου δώσει τη λύση. Ευχαριστώ !

Για διάβασε εδώ, βοηθάει?

 

http://apps.teipir.gr/mhx_nz_csharp/lectures/Lecture04.pdf

Edited by 'Baggos'

#include <stdio.h>

void shift(int*);

int main(void)
{
int a;
printf("Doste tin timi a");
scanf("%d",&a);
shift(&a);
printf("H kenouria timi tou a einai : %d",a);
}

void shift(int *a)
{
*a=0;
}

Σημειώσεις:

Δουλεψα με δείκτες γιατί μου λες οτι η συνάρτηση δεν κάνει τίποτα (void)

Δεν το εχω δοκιμασει μπορει να εχω κανει κανενα λαθακι.

Create an account or sign in to comment

Account

Navigation

Search

Search

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.