0
What to do if we want to print the string values in the output like name or any thing else using for loop
11 Antworten
+ 1
seems you wanna deep learning of for loop ;) carry on !!
0
Sop !!
0
mmm I didn't get that...
0
System.out.println(" Your String ");
0
Or Elaborate your question !!
0
yeah it Worked Thank you Shubham Tysm..😃😊
0
are you too a bigineer :p
0
Actually after trying this code
public class Program {
public static void main(String[] args) {
for(int x = 1; x <=5; x++) {
System.out.println(x);
}
}
}
I understood how to print numbers but I thought what we will have to do if we want to give output string values...
and your ans sop actually helped Ty my problem is solved
0
now show me how to print both string alongwith int datatype
0
This is how we will print string values along with int data type
public class Program {
public static void main(String[] args) {
String s = "world";
for(int x = 1; x <=5; x++) {
System.out.println(x+" "+"hello " +s+"!");
}
}
}
0
And yes I am a Beginner... :) :p