- 3
How to write a code Print your name 4 times in a single line
without using for loop
2 Réponses
+ 11
# Python 🐍
print('Mukesh'*4)
+ 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 ");
}