Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR C

print in c 11111 00000 11111 00000 11111

/**
 * C program to print number pattern of 1, 0 at even/odd rows
 */

#include 

int main()
{
    int rows, cols, i, j;

    /* Input rows and columns from user */
    printf("Enter number of rows: ");
    scanf("%d", &rows);
    printf("Enter number of columns: ");
    scanf("%d", &cols);

    for(i=1; i<=rows; i++)
    {
        for(j=1; j<=cols; j++)
        {
            printf("%d", (i%2));
        }

        printf("
");
    }

    return 0;
}
Source by www.atnyla.com #
 
PREVIOUS NEXT
Tagged: #print
ADD COMMENT
Topic
Name
8+9 =