Write a c program using for loop to print typical pattern if
number of rows is entered by keyboard.
ABCBA
AB BA
A A
Answer Posted / a.jayashree
#include<stdio.h>
#include<string.h>
main()
{
char a[5];
int i=0,j=0;
printf("enter the string");
scanf("%s",a);
printf("\n%s",a);
for(i=0;i<a[5];i++)
{
if(a[i]==a[2])
{
printf("\n\t");
}
else
{
printf("%s",a);
}
}
for(j=0;j<a[5];j++)
{
if(a[j]==a[1])
{
if(a[j]==a[2])
{
if(a[j]==a[3])
{
printf("\n\t\t\t");
}
else
{
printf("%s",a);
}
}
}
}
}
| Is This Answer Correct ? | 2 Yes | 6 No |
Post New Answer View All Answers
c language interview questions & answer
What is meant by operator precedence?
Is that possible to store 32768 in an int data type variable?
What does the file stdio.h contain?
what is the diffrenet bettwen HTTP and internet protocol
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Differentiate between a structure and a union.
How can a string be converted to a number?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
Write a C program to count the number of email on text
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
how we can make 3d venturing graphics on outer interface
What is the correct code to have following output in c using nested for loop?
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