Answer to Question #329931 in C for ram

Question #329931

Get the input from the user for the number of rows and columns.


Print 0 in the row one.


Print 1 in the row two.


Case= Test 1

input=

5

5



output=

00000

11111

00000

11111

00000


1
Expert's answer
2022-04-18T08:40:58-0400
#include <stdio.h>


int main() {
    int row, col;
    int i, j;


    scanf("%d", &row);
    scanf("%d", &col);


    for (i=0; i<row; i++) {
        for (j=0; j<col; j++) {
            printf("%d", i%2);
        }
        printf("\n");
    }
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS