Welcome Guest.

1Answers

C language program question

Asked by: Craig 7 views IT May 25, 2023

Write the results of the following program

#include

main ()

{int i, j;

for (i = 1; I <10; i ++)

for (j = 1; j <<= i; j ++)

Printf ((j == i)? "M \ n": "m", i*j);

}

1 Answers

  1. +4Votes  

    Program running results

    m
    Mm
    Mmm
    Mmmm
    Mmmmm
    Mmmmm
    Mmmmmm
    Mmmmmmm
    MMMMMMMMM

    Analysis:

    This is a simple dual -cycle i co -cycle 9 times, J from 1 to i, when j! = I, output letter m, when j ==When i, output one from the change

    Murray- May 25, 2023 |

Answer Question