write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / karthikeyan.cse ist year.skce
main()
{
int i,n=65,m=72,f=0,s=-6;
clrscr();
while(m-->=n)
{
s+=4;
for(i=n;i<m;i++)
{
printf("%c ",i);
}
}
if(f==0)
{ ++m;
}
else{
for(i=0;i<s;i++) printf(" ");
{
for(i=m-1;i>=n;i--)
{
printf("%c ",i);
}
}
printf("\n");f=1;
}
}
getch();
| Is This Answer Correct ? | 11 Yes | 9 No |
Post New Answer View All Answers
What are local variables c?
What is line in c preprocessor?
Explain why can’t constant values be used to define an array’s initial size?
Write a program to show the change in position of a cursor using c
What are the disadvantages of a shell structure?
What is the correct declaration of main?
What is the difference between single charater constant and string constant?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
Why does the call char scanf work?
Is null a keyword in c?
What is difference between Structure and Unions?
Do variables need to be initialized?
What is the purpose of void in c?
Can we declare a function inside a function in c?
Why can’t constant values be used to define an array’s initial size?