- 3

How to write a code Print your name 4 times in a single line

without using for loop

5th Nov 2017, 5:21 AM
Mukesh Kaduru
Mukesh Kaduru - avatar
2 Réponses
+ 11
# Python 🐍 print('Mukesh'*4)
5th Nov 2017, 5:59 AM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 2
You didn't specify what language you're using. Java: EXAMPLE 1: String name = "Mukesh"; System.out.print(name + name + name + name); EXAMPLE 2: System.out.print("Mukesh "+ "Mukesh " + "Mukesh "+ "Mukesh "); EXAMPLE 3: int i = 0; for(i = 0; i < 4; ++i){ System.out.print("Mukesh "); }
5th Nov 2017, 5:37 AM
AgentSmith