write a program to print a string in a given pattern
I
N
D
I
A
Answers
Answered by
2
I can help with Java, will that work?
Snippet:
public void pattern1(){
String pattern = "INDIA"
for (int n=0; n<pattern.length(); n++){
System.out.println(pattern.charAt(n));
}
}
Hopefully you know how to call functions in the main function...
Snippet:
public void pattern1(){
String pattern = "INDIA"
for (int n=0; n<pattern.length(); n++){
System.out.println(pattern.charAt(n));
}
}
Hopefully you know how to call functions in the main function...
Anonymous:
Hi
Answered by
1
Import Java. until. *
Public class pattern
{
Public static void main (String arg[])
{
Scanner in=new Scanner(System.in)
Int a,b
String st
System. Out. println("enter word to display pattern")
St=in.next()
b=st.length()
System. Out. println("pattern is")
for(a=0 ,a<b,a++)
{
System. Out. println (at. CharAt(0))
}
}
}
// program ends
HOPE It HELPS U
Similar questions