How to print the second row of a matrix of characters in C

1 Answer

0 votes
#include <stdio.h>
#include <string.h>
 
int main() {
    char matrix[][4] = {
        {'a', 'b', 'c', '\0'},
        {'d', 'e', 'f', '\0'},
        {'g', 'h', 'i', '\0'},
        {'j', 'k', 'l', '\0'}};
 
    printf("%s", matrix[1]);
}
 
  
   
/*
run:
   
def
   
*/

 



answered Apr 15, 2024 by avibootz

Related questions

1 answer 110 views
1 answer 146 views
1 answer 131 views
1 answer 218 views
1 answer 159 views
...