write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A
Answer Posted / atul wagare
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,l,m;
for(i=0;i<7;i++)
{
for(j=0;j<7-i;j++)
{
printf("%c",j+65);
}
for(k=1;k<=i*2-1;k++)
{
printf(" ");
}
if(i==0||i==1)
{
for(l=70;l>=65;l--)
{
printf("%c",l);
}
}
else
{
for(l=70-(i-1);l>=65;l--)
{
printf("%c",l);
}
}
//printf("%d %d",j,k);
printf("
");
}
getche();
}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What's the difference between constant char *p and char * constant p?
Explain the difference between the local variable and global variable in c?
What is advantage of pointer in c?
What are 3 types of structures?
What is 2c dna?
What is the difference between array and pointer in c?
Function calling procedures? and their differences? Why should one go for Call by Reference?
What is the right type to use for boolean values in c?
What is the difference between local variable and global variable in c?
what do you mean by inline function in C?
How many types of operator or there in c?
Is null always defined as 0(zero)?
where are auto variables stored? What are the characteristics of an auto variable?
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.
Explain which function in c can be used to append a string to another string?