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 ? | 1 Yes | 2 No |
Post New Answer View All Answers
What are the header files used in c language?
c language interview questions & answer
What are the modifiers available in c programming language?
Why structure is used in c?
Is the exit() function same as the return statement? Explain.
How do you convert strings to numbers in C?
What is the difference between a string and an array?
write a program in c language to print your bio-data on the screen by using functions.
Why is c platform dependent?
What is function prototype?
Describe wild pointers in c?
What are the parts of c program?
What is default value of global variable in c?
Explain data types & how many data types supported by c?
What do mean by network ?