How to print India by nested loop?
I
IN
IND
INDI
INDIA
Answers were Sorted based on User's Feedback
Answer / chavidi
void main()
{
char a[20];
int i,j,k;
clrscr();
gets(a);
j=strlen(a);
i=0;
while(i<j)
{
for(k=0;k<=i;k++)
{
printf("%c",a[k]);
}
printf("\n");
i++;
}
}
//APPLICABLE FOR ANY STRING
| Is This Answer Correct ? | 19 Yes | 12 No |
Answer / ashim ghosh
#include<stdio.h>
#include<conio.h>
void main()
{
char arr[20]={"INDIA"};
int i,j;
for(i=0;i<=5-1;i++)
{
for(j=0;j<=i;j++)
{
printf("%c",arr[j]);
}
printf("\n")
}
getch();
}
| Is This Answer Correct ? | 18 Yes | 12 No |
Answer / 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 |
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char name[20];
int a;
clrscr();
printf("enter the INDIA name");
scanf("%c",&name);
a=strlen(name);
for(int i=0;i<=a;i++)
{
for(int j=0;j<=i;j++)
{
printf("%c",name[i]);
}
printf("\n");
}
getch();
}
| Is This Answer Correct ? | 1 Yes | 12 No |
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Difference between Class and Struct.
13 Answers Ericsson, Motorola, Wipro,
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
List the different types of c tokens?
write a program that will accept two integers and will implement division without using the division operator if the second value is an odd number and will implement multiplication without using multiplication operator if the second value is an even number.
Develop a flow chart and write a c program to find the roots of a quadratic equation ax2+bx+c=0 using switch and break statement.
How can you access memory located at a certain address?
i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical
difference between object file and executable file
write a c program to find biggest of 3 number without relational operator?
If input is 123 then how to print 100 and 20 and 3 seperately?
Why is c known as a mother language?