Fill This Form To Receive Instant Help
Homework answers / question archive / Using two for loops, can you write a code snippet that would produce the following output? X XX XXX XXXX XXXXX
Using two for loops, can you write a code snippet that would produce the following output?
X
XX
XXX
XXXX
XXXXX
See below code. Also attached.
#include <stdio.h>
int main()
{
for (int i = 0 ; i < 5 ; i++)
{
for (int j = 0 ; j < i + 1; j++)
{
printf ("X") ;
}
printf ("n") ;
}
return 0;
}