Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,895 questions

51,826 answers

573 users

How to print a matrix of char and number from A1 A2 ... A9 until O1 O2 ... O9 in C

1 Answer

0 votes
#include <stdio.h> 

int main(int argc, char **argv) 
{
    int n;
    char ch;

    for(ch = 'A'; ch <= 'O'; ch++)
    {
        for(n = 1; n <= 9; n++)
            printf("%c%d\t",ch ,n);
        putchar('\n');
    }

    return 0;
}


/*
run:

A1      A2      A3      A4      A5      A6      A7      A8      A9
B1      B2      B3      B4      B5      B6      B7      B8      B9
C1      C2      C3      C4      C5      C6      C7      C8      C9
D1      D2      D3      D4      D5      D6      D7      D8      D9
E1      E2      E3      E4      E5      E6      E7      E8      E9
F1      F2      F3      F4      F5      F6      F7      F8      F9
G1      G2      G3      G4      G5      G6      G7      G8      G9
H1      H2      H3      H4      H5      H6      H7      H8      H9
I1      I2      I3      I4      I5      I6      I7      I8      I9
J1      J2      J3      J4      J5      J6      J7      J8      J9
K1      K2      K3      K4      K5      K6      K7      K8      K9
L1      L2      L3      L4      L5      L6      L7      L8      L9
M1      M2      M3      M4      M5      M6      M7      M8      M9
N1      N2      N3      N4      N5      N6      N7      N8      N9
O1      O2      O3      O4      O5      O6      O7      O8      O9

*/ 


answered Apr 29, 2015 by avibootz
...