comparar quebra de linha

an anonymous user · March 12, 2021 · C
#include <stdio.h>

int main() {

     int ascii, i;
     char texto[] = "Bom dia\nGood Moring\nBonjour";
     
     printf("%s\n------------\n", texto);
     
     for(i=0; texto[i]; i++) {
        
        ascii = (int)texto[i];
        if (ascii == 10) {
            printf("Quebra de linha\n");
        } else {
            printf("%c = %d\n",texto[i],ascii);
        }
    }
}

Comments

Please sign up or log in to contribute to the discussion.