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
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is the sizeof () operator?
What is a pragma?
What is .obj file in c?
What are the 4 types of organizational structures?
What is union and structure?
Can you please explain the difference between exit() and _exit() function?
Where are c variables stored in memory?
Explain how do you generate random numbers in c?
What is restrict keyword in c?
write a program for the normal snake games find in most of the mobiles.
What are the advantages of c language?
Why C language is a procedural language?
Explain data types & how many data types supported by c?
Why calloc is better than malloc?