How to print India by nested loop?
I
IN
IND
INDI
INDIA
Answer Posted / rashi
class Find{
public static void main (String args[])
{
String s="India";
int i,j;
l=s.length();
for(i=0;i<l;i++)
{
for (j=0;j<=i;j++)
{
char ch=S.charAt(i);
System.out.print(ch);
}
System.out.println(" ");
}
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
Is it possible to initialize a variable at the time it was declared?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Why does everyone say not to use gets?
Can we declare function inside main?
Why do we use & in c?
What is the scope of an external variable in c?
in case any function return float value we must declare a) the function must be declared as 'float' in main() as well b) the function automatically returned float values c) function before declared 'float' keyword d) all the above
Differentiate between #include<...> and #include '...'
Can we replace the struct function in tree syntax with a union?
What is the purpose of void pointer?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
What is array of pointers to string?
What are reserved words?
What are predefined functions in c?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.