write a program to produce the following output;
ABCDEFGFEDCBA
ABCDEF FEDCBA
ABCDE EDCBA
ABCD DCBA
ABC CBA
AB BA
A A

Answers were Sorted based on User's Feedback



write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / ravinder singh

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n = 1;
for(char i=71; i>=65; i--)
{
for(char j=65;j<=i; j++)
{
cout<<j;
}
if(i!=71)
{

for(int x=2; x<n; x++)
{
cout<<" ";
}
}
if(i==71)
{
for(char k=i-1; k>=65;k--)
{
// if(k==71)
// continue;
cout<<k;
}
}
else if(i==70||i==69||i==68||i==67||i==66||i==65)
{
for(char k=i; k>=65;k--)
{
cout<<k;
}
}
n = n+2;

cout<<"\n";

}

getch();
}

Is This Answer Correct ?    1 Yes 1 No

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / neeraj kumar

#include<stdio.h>
#include<conio.h>
main()
{
int a,x,n=71,o=70,y=1,c;
clrscr();
for(x=1;x<=7;x++)
{
for(a=65;a<=n;a++) // loop for printing ABCDEFG
printf("%c",a);
if(x==2)
o=70;
for(c=2;c<y;c++) //space loop
printf(" ");
for(a=o;a>=65;a­­) // loop for printing FEDCBA
printf("%c",a);
printf("
"); // to sta
n­­;
o­­;
y=y+2;
}g
etch();
} (g
) Write a program to fill the entire screen with diamond and heart alternatively. The ASCII
value for heart is 3 and that of diamond is 4.
#include<stdio.h>
#include<conio.h>
main()
{
int a, b,c,d;
clrscr();
for(c=1;c<=37;c++)
{
for(d=1;d<=49;d++)
{
for(a=4;a<=4;a++)
{
for(b=3;b<=3;b++)
printf("%c%c ",a,b);
}
}
}
getch();

Is This Answer Correct ?    0 Yes 0 No

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / 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

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / shariq

can anyone solve this example by using string??
and is it possible ??
please answer my question ......

Is This Answer Correct ?    0 Yes 0 No

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / siddharth shravan jha

//Most Easy Way to Solve this type of questions.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k,r,m;

for(i=0;i<7;i++)
{
r=71-i;
for (j=65;j<=r;j++) //ASCII values for A-Z is in range 65-91,i.e.,for A-G is from 65-71
{
printf("%c ",j);
}
for (m=1;m<=i;m++)
{
printf(" ");
}
for (k=r;k>=65;k--)
{
printf(" %c",k);
}
printf("
");
}

}

Is This Answer Correct ?    0 Yes 0 No

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / karthikeyan ist year cse skc

in()
{
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 ?    5 Yes 6 No

write a program to produce the following output; ABCDEFGFEDCBA ABCDEF FEDCBA ABCDE EDCBA ABCD ..

Answer / smar tass

#include <stdio.h>

int main (void) {
printf('ABCDEFGFEDCBA\nABCDEF FEDCBA\nABCDE EDCBA\nABCD DCBA\nABC CBA\nAB BA\nA A\n');
return 0;
}

Is This Answer Correct ?    8 Yes 14 No

Post New Answer

More C Interview Questions

What is getche() function?

0 Answers  


What is the use of a static variable in c?

0 Answers  


Why we not create function inside function.

0 Answers  


What is the symbol indicated the c-preprocessor?

0 Answers  


What are linker error?

0 Answers  






What is the use of function overloading in C?

0 Answers   Ittiam Systems,


convert 0.9375 to binary

2 Answers   CTS, TANCET,


Three major criteria of scheduling.

1 Answers  


How do i store a paragraph into a string? for example, if i input a long paragraph, the program will read the words one by one and concatenate them until no word is left.

1 Answers  


How can I sort a linked list?

0 Answers  


Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.

4 Answers  


What does == mean in texting?

0 Answers  


Categories