Using "Nested For" Loop, Write a program that prints the letter M.


Thank you All!

Recommended Answers

All 6 Replies

Using "Nested For" Loop, Write a program that prints the letter M.


Thank you All!

We can't do your homework for you, but we can help. You need to show some effort first.

Try it and post the resultant code. If it doesn't work, fine, we'll help you make it work.

???

for(int i = 0; i !=1; ++i)
    cout << "M"<<endl;

FirstPerson... I think the OP asked for a nested for loop :P

FirstPerson... I think the OP asked for a nested for loop :P

Oh ok :

for(int i = 0; i !=1; ++i){
    cout << "M"<<endl;
for(int thisIsStupid = 0; thiIsStupid != 0; );         
}
commented: Best. Code. Ever. +10

Sorry Guys,, I meant a letter M of stars "*"
As I know, we should use nested "For loops" and also use id statement inside it.

laugh out loud :D

How about this:

for(int i=0; i==0; i=0)
    for(int j=0; j<1; j++)
          cout << "M";

OP: you might want to check this out before you continue to act a fool up in here.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.