Computer Science, asked by coolnike, 1 year ago

write a program to print a string in a given pattern
I
N
D
I
A

Answers

Answered by TheIncorporealKlaus
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...

Anonymous: Hi
TheIncorporealKlaus: Yep?
Anonymous: hii
Anonymous: hii
Anonymous: i m fyn
Answered by Anonymous
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




Anonymous: hii
Similar questions