JustPaste
HomeCategoriesAboutDonateContactTerms of UsePrivacy Policy
JustPaste

Free online notepad — write and share instantly

Navigate

  • Home
  • Timeline
  • Categories

Info

  • About
  • Donate
  • Contact

Legal

  • Terms of Use
  • Privacy Policy

© 2026 JustPaste.app. All rights reserved.

Made with ♥ by JustPaste

Untitled Page | JustPaste.app
8 months ago110 views
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
    int n;
    int T[50];
    int i = 0;

    printf("donner la taille du tableau: ");
    scanf("%d", &n);

    while (i < n) {
        printf("T[%d] = ", i);
        scanf("%d", &T[i]);
        i++;
    }

    printf("\ntableau T:\n");
    i = 0;
    while (i < n) {
        printf("T[%d] = %d\n", i, T[i]);
        i++;
    }

    printf("indices des nuls: ");
    i = 0; 
    while (i < n) {
        if (T[i] == 0)
            printf("%d ", i);
        i++;
    }
     int debut = 0, fin = n - 1, temp;
    while (debut < fin) {
        temp = T[debut];
        T[debut] = T[fin];
        T[fin] = temp;

        debut++;
        fin--;
    }

    printf("\ntableau T reverse:\n");
    for (i = 0; i < n; i++) {
        printf("T[%d] = %d\n", i, T[i]);
    }


    return 0;
}

⚠️Content was pasted as plain text and auto-formatted as a code block. Use the Code Block button in the editor for proper formatting.

← Back to timeline