avatar
Untitled

Guest 197 22nd Jan, 2023

MARKUP 0.73 KB
                                           
                         #include <stdio.h>
#include <string.h>

int main(int argc, char *argv[]) {
    if (argc != 2) {
        printf("uzycie: %s <imie>\n", argv[0]);
        return 1;
    }

    char *name = argv[1];
    if(strcmp(name, "Konrad") != 0) {
        while(strcmp(name, "Konrad") != 0) {
            printf("podaj moje poprawne imie\n");
            scanf("%s", name);
            printf("imie podane przez input prompt\n");
        }
    }
    else
        printf("imie podane poprzez commandline argument\n");
    int x = strlen(name);
    printf("czesc, %s! dlugosc Twojego imienia to: %d\n", name, x);

    return 0;
}
                      
                                       
To share this paste please copy this url and send to your friends
RAW Paste Data
Recent Pastes
Ta strona używa plików cookie w celu usprawnienia i ułatwienia dostępu do serwisu oraz prowadzenia danych statystycznych. Dalsze korzystanie z tej witryny oznacza akceptację tego stanu rzeczy.
Wykorzystywanie plików Cookie
Jak wyłączyć cookies?
ROZUMIEM