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 pointers? What are stacks and queues?
Are the outer parentheses in return statements really optional?
What is c language & why it is used?
Are pointers integers in c?
Write a program to find factorial of a number using recursive function.
Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.
Write a program to check palindrome number in c programming?
Is exit(status) truly equivalent to returning the same status from main?
Difference between exit() and _exit() function?
difference between Low, Middle, High Level languages in c ?
Why do we use null pointer?
the question is that what you have been doing all these periods (one year gap)
Why header file is used in c?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
When is the “void” keyword used in a function?